Repository navigation
Add systemd readiness and stopping notifications - #151
Merged
Merged
Conversation
|
👋 Thanks for assigning @joostjager as a reviewer! |
joostjager
reviewed
Mar 16, 2026
| // systemd sets NOTIFY_SOCKET to either a filesystem path (e.g. /run/systemd/notify) | ||
| // or an abstract socket prefixed with '@'. Abstract sockets require special addressing. | ||
| let result = if let Some(abstract_name) = socket_path.strip_prefix('@') { | ||
| use std::os::linux::net::SocketAddrExt; |
Contributor
There was a problem hiding this comment.
Still a fully qualified name below, but I guess in the claude-era we don't care as much anymore...
Collaborator
Author
There was a problem hiding this comment.
Normally i would care but since all the logic is gated behind the linux flag, it gets pretty ugly having to gate all the imports as well
| }, | ||
| }; | ||
|
|
||
| // systemd sets NOTIFY_SOCKET to either a filesystem path (e.g. /run/systemd/notify) |
Contributor
There was a problem hiding this comment.
Did you manually test both socket types?
If NOTIFY_SOCKET is set, send READY=1 and STOPPING=1 to systemd. This enables proper dependency ordering and faster startup detection when running as a Type=notify service unit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
joostjager
approved these changes
Mar 17, 2026
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.
If NOTIFY_SOCKET is set, send READY=1 and STOPPING=1 to systemd. This enables proper dependency ordering and faster startup detection when running as a Type=notify service unit.
Noticed this when deploying my own mainnet ldk-server on my server