Skip to content

Conversation

@bastelfreak
Copy link
Contributor

Code adapted with permission of the original author (this author) from
nrepl socket.clj.

cf. https://www.freedesktop.org/software/systemd/man/sd_notify.html


This is a refactored version of #20

@bastelfreak bastelfreak self-assigned this Aug 26, 2025
@bastelfreak bastelfreak added the enhancement New feature or request label Aug 26, 2025
@bastelfreak bastelfreak force-pushed the sd_notify branch 4 times, most recently from d4c500c to 72833f5 Compare August 26, 2025 20:41
@bastelfreak bastelfreak force-pushed the sd_notify branch 2 times, most recently from 6432e58 to 72833f5 Compare August 27, 2025 10:45
@bastelfreak bastelfreak marked this pull request as ready for review January 1, 2026 10:56
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 2, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 2, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
@bastelfreak
Copy link
Contributor Author

bastelfreak commented Jan 3, 2026

This is now working properly. I did a build with:

DEP_REBUILD=clj-parent,trapperkeeper DEP_REBUILD_ORG=bastelfreak DEP_REBUILD_BRANCH=sd_notify_2 EZBAKE_VERSION=2.8.0-SNAPSHOT EZBAKE_REPO='https://github.com/bastelfreak/ezbake' EZBAKE_BRANCH='notify' DEB_PLATFORMS='ubuntu-24.04' RPM_PLATFORMS='' bundle exec rake vox:build

Trapperkeeper will then check if the environment variable NOTIFY_SOCKET is set. systemd sets it by default when Type=notify or Type=notify-reload is set. Trapperkeeper will inform systemd when the service is started or reloaded. And the service can be reloaded via systemd. trapperkeeper will issue inform systemd about the successful start/reload after [p.s.m.master-service] Puppet Server has successfully started and is now ready to handle requests / after the first jruby instance is up and running.

To actuallly use this feature, we will have to update ezbake to switch to Type=notify-reload in the service section.

@bastelfreak bastelfreak merged commit 537c946 into OpenVoxProject:main Jan 3, 2026
4 checks passed
@rbrw
Copy link
Contributor

rbrw commented Jan 5, 2026

While I haven't reviewed the changes carefully, I did notice that the new version will now suppress a send error (via .send SocketException) and log it as a connection error. The original code was intentionally limiting the scope of that catch to the .connect because connect exceptions are expected, while .send exceptions are not.

bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 7, 2026
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants