lnicola / sd-notify

Apache License 2.0
45 stars 6 forks source link

Support file descriptor store messages #8

Closed cbranch closed 1 month ago

cbranch commented 9 months ago

Support for systemd's file descriptor store is added using new NotifyState variants and a new notify_with_fds function, which passes file descriptors over the NOTIFY_SOCKET. The capability is gated behind a "fdstore" feature to avoid adding dependencies that were not previously required, and no existing API is touched except for the feature-gated NotifyState enum.

As stored file descriptors can be named, you should be able to retrieve file descriptors by those names. This is implemented via the new listen_fds_with_names function, and is also useful if you are using socket activation.

cbranch commented 9 months ago

Missed a clippy lint, this should pass now.

cbranch commented 8 months ago

Do you have any opinions on the design choices made here? In particular, the changes added to support passing file descriptors through the notify socket.

cbranch commented 5 months ago

For the benefit of notifs: outstanding issues should be resolved, please go ahead and merge/release as you see fit. It would be good to have a listen_fds with unset_env flag though!

cbranch commented 1 month ago

Bumping this change - this would be great to get in a minor semver bump if you are ready to create one :)

lnicola commented 1 month ago

https://crates.io/crates/sd-notify/0.4.3 is now out, sorry again for my abysmal response times :pensive:.