-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): support listener passed by systemd for socket activation
This patch adds support for server to be used with systemd's socket activation by expecting an open file descriptor to be announced using environment variables. To make use of this set either HTTPListenNetwork or GRPCListenNetwork to "sd_listen_fd" and HTTPListenAddress or GRPCListenAddress either to an ASCII string passed as the "FileDescriptorName" from a systemd.socket unit or "LISTEN_FD_$n", where $n is the file descriptor number. By default, when using "sd_listen_fd", the address will be "LISTEN_FD_3". This patch makes use of the coreos/go-systemd/v22/activation library (which was already included as an indirect dependency). Unfortunately their implementation doesn't allow call sites to get a view of the listeners both by file descriptor number and file descriptor name, as the highlevel helpers cannot be used. See https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html#FileDescriptorName=
- Loading branch information
1 parent
f52de24
commit 5207101
Showing
3 changed files
with
51 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters