mitsuhiko/systemfd là dự án Rust với 662 sao. Development helper utility for helping with auto reloading for projects supporting systemd socket activation
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
systemfd is the 1% of systemd that's useful for development. It's a tiny process that
opens a bunch of sockets and passes them to another process so that that process can
then restart itself without dropping connections. For that it uses the systemd socket
passing protocol (LISTEN_FDS + LISTEN_PID) environment variables on macOS and Linux
and a custom protocol on Windows. Both are supported by the
listenfd crate.
When combined with cargo-watch or
watchexec you can get automatically
reloading development servers:
The --no-pid flag disables passing the LISTEN_PID variable on unix (it has no effect
on Windows). This makes listenfd skip the pid check which would fail with
cargo watch otherwise. To see how to implement a server ready for systemfd
see below.
Installation
You can install a precompiled version of systemfd with curl to bash:
curl -sSfL https://github.com/mitsuhiko/systemfd/releases/latest/download/systemfd-installer.sh | sh
Alternatively you can get systemfd by installing it with cargo:
cargo install systemfd
Usage
systemfd creates one or more sockets as specified on the command line and then
invokes another application. Each time you pass the -s (or --socket)
parameter a new socket is created. The value for the parameter is a socket
specification in the format [TYPE::]VALUE where TYPE defaults to tcp or
unix depending on the value. The following types exist:
tcp: creates a tcp listener
http: creates a tcp listener for http usage (prints a http url in the info output)
https: creates a tcp listener for https usage (prints a https url in the info output)
unix: creates a unix listener socket
udp: creates a udp socket
VALUE depends on the socket type. The following formats are supported:
<port>: an integer port value, assumes 127.0.0.1 as host
<host>:<port>: binds to a specific network interface and port
When systemfd starts it will print out the socket it created. This can be disabled
by passing -q. Additionally if a port is set to 0 a random port is picked.
Windows Protocol
On Windows, passing of sockets is significantly more complex than on Unix. To
achieve this, this utility implements a custom socket passing system that is also
implemented by the listenfd crate. When the sockets are created, an additional
local RPC server is spawned that gives out duplicates of the sockets to other
processes. The RPC server uses TCP and is communicated to the child with the
SYSTEMFD_SOCKET_SERVER environment variable. The RPC calls themselves are
protected with a SYSTEMFD_SOCKET_SECRET secret key.
The only understood command is SECRET|PID with secret and the processes' PID
inserted. The server replies with N WSAPROTOCOL_INFOW structures. The client
is expected to count the number of bytes and act accordingly.
This protocol is currently somewhat of a hack and might change. It only
exists to support the listenfd crate.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/mitsuhiko/systemfd là nguồn chính thức.
mitsuhiko/systemfd có bao nhiêu sao?
mitsuhiko/systemfd có 662 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/mitsuhiko/systemfd. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
mitsuhiko/systemfd có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho mitsuhiko/systemfd. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
mitsuhiko/systemfd còn đang phát triển không?
Commit gần nhất trên mitsuhiko/systemfd là 1.8 năm trước (theo timestamp GitHub). Repo có 18 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
mitsuhiko/systemfd viết bằng ngôn ngữ gì?
mitsuhiko/systemfd chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về systemfd?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về systemfd.