Add default reload function#1032
Draft
funderscore1 wants to merge 4 commits into
Draft
Conversation
funderscore1
commented
Jul 1, 2026
| reloadsig=HUP | ||
| ``` | ||
|
|
||
| For most daemons this is sufficient, though note it only works on OpenRC TODO. |
Author
There was a problem hiding this comment.
This needs to be adjusted before merging
navi-desu
reviewed
Jul 1, 2026
|
|
||
| local startchroot="$(service_get_value "chroot")" | ||
| local startpidfile="$(service_get_value "pidfile")" | ||
| chroot="${startchroot:-$chroot}" |
Member
There was a problem hiding this comment.
supervise-daemon pidfiles are neither stored in chroot, nor used for signal, sendsig uses an internal fifopath
added 4 commits
July 3, 2026 19:12
In the past what has been recommended for having a way to reload a daemon's configuration was to write a reload() function manually. Over the years many openrc scripts in, for instance, Alpine aports that have a reload() function are pretty much all the same (manually using start-stop-daemon to send a signal). Provide a default reload function that does exactly that. Those service scripts now only have to define `reloadsig=` to the signal to be sent on reload, for example `reloadsig=HUP`, and can drop their custom reload function. Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
…top}-daemon Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
9d96da4 to
29c7c32
Compare
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.
Historically, reload was meant to be implemented by the service script. However in the end it seems most service scripts just send a signal by calling
start-stop-daemondirectly, something that can easily be done as a default and would reduce duplication.Add default reload functions for both supervise-daemon and start-stop-daemon, which just send a signal to a service. The signal to send is configured by just setting:
reloadsig=USR1 # signal to send to trigger reloadFor service scripts that need to do other things on reload, they can define their own reload function just like before.