-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
notify: Send all sd_notify signals from main caddy process #4060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f9d889f to
ceda5c5
Compare
|
I think this looks good now! |
ceda5c5 to
f559bb1
Compare
|
https://github.com/carlwgeorge/caddy/blob/f559bb10f64e09e4462591f841a14a2aed0f994d/notify/notify_linux.go#L45 has a typo that #4081 aims to fix, would you mind making the change in here (to avoid the conflict)? |
Initial sd_notify support was added in caddyserver#3963, but that sent signals from both cmdRun and cmdReload. This approach has two drawbacks: - Reloads initiated via the API do not send signals. - The signals are sent from different processes, which requires the `NotifyAccess=exec` directive in the unit file. This change moves the NotifyReloading and NotifyReadiness invocations to Load, which address both of those drawbacks. It also adds a complimentary NotifyStopping method which is invoked from handleStop. All the notify methods are defined in a notify package to avoid an import loop.
f559bb1 to
d183366
Compare
|
Sure thing, added that typo fix and went ahead and rebased on master. |
francislavoie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
@rumpelsepp Do you have any thoughts about this?
|
These adjustments make sense, I would say. 👍 |
mholt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you very much for the enhancement.
Initial sd_notify support was added in #3963, but that sent signals from both cmdRun and cmdReload. This approach has two drawbacks:
NotifyAccess=execdirective in the unit file.This change moves the NotifyReloading and NotifyReadiness invocations to Load, which address both of those drawbacks. It also adds a complimentary NotifyStopping method which is invoked from handleStop. All the notify methods are defined in a notify package to avoid an import loop.