daemon: Add SdNotifyWithFiles and SdNotifyBarrier#520
Open
WGH- wants to merge 2 commits into
Open
Conversation
This function allows to send an array of additional file descriptors to the service manager. This is mostly used for FDSTORE=1 messages, and BARRIER=1 can be implemented on top of this as well. This corresponds to sd_pid_notify_with_fds in libsystemd, but without pid support. If sd_notify_with_fds existed, that would be the complete equivalent.
This function blocks until all notifications sent before it have been processed by the service manager. This is the equivalent of libsystemd's sd_notify_barrier.
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.
This PR implements
SdNotifyWithFilesandSdNotifyBarrieron top of the former (replaces abandoned #343).SdNotifyWithFilesmirrorssd_pid_notify_with_fdsfrom libsystemd, except it doesn't have pid support. Ifsd_notify_with_fdsexisted, that would be the complete equivalent. This function is useful forFDSTORE=1state messages.SdNotifyBarrieris implemented on top ofSdNotifyWithFiles. This is full equivalent ofsd_notify_barrier. For example, it's used for synchronization after sendingMAINPID=...message to guarantee that the service manager updates the main PID before the old one exits.sd_notifyman explains all these functions better than I do.