Skip to content

daemon: Add SdNotifyWithFiles and SdNotifyBarrier#520

Open
WGH- wants to merge 2 commits into
coreos:mainfrom
WGH-:notify-with-fds
Open

daemon: Add SdNotifyWithFiles and SdNotifyBarrier#520
WGH- wants to merge 2 commits into
coreos:mainfrom
WGH-:notify-with-fds

Conversation

@WGH-

@WGH- WGH- commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This PR implements SdNotifyWithFiles and SdNotifyBarrier on top of the former (replaces abandoned #343).

SdNotifyWithFiles mirrors sd_pid_notify_with_fds from libsystemd, except it doesn't have pid support. If sd_notify_with_fds existed, that would be the complete equivalent. This function is useful for FDSTORE=1 state messages.

SdNotifyBarrier is implemented on top of SdNotifyWithFiles. This is full equivalent of sd_notify_barrier. For example, it's used for synchronization after sending MAINPID=... message to guarantee that the service manager updates the main PID before the old one exits.

sd_notify man explains all these functions better than I do.

WGH- added 2 commits June 12, 2026 21:08
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.
@WGH- WGH- force-pushed the notify-with-fds branch from da22f1c to b7a08d7 Compare June 14, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant