cmdext: Add pass_systemd_fds() for socket activation fd passing#92
Open
cgwalters wants to merge 1 commit intocoreos:mainfrom
Open
cmdext: Add pass_systemd_fds() for socket activation fd passing#92cgwalters wants to merge 1 commit intocoreos:mainfrom
cgwalters wants to merge 1 commit intocoreos:mainfrom
Conversation
We want good support for systemd LISTEN_FDS protocol, it's a bit subtle and complex because we need to set LISTEN_PID which can only be done via custom `setenv` right now because we don't know the PID until post-fork obviously. Then there's the next problem - take_fd_n is I/O safe for the parent but not the target process - it's easy to have overlapping fds set for the child. To fix this add a `CmdFds` struct that is source of truth for all child process fds (that we control) and detects conflicts and panics. It can be constructed with a LISTEN_FDs set. Assisted-by: OpenCode (Claude claude-opus-4-6) Signed-off-by: Colin Walters <walters@verbum.org>
b0aa7db to
94191c9
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a bit too complicated to use the systemd socket protocol, let's make it simpler.
Assisted-by: OpenCode (Claude claude-opus-4-6)