-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Restarting socket units #73853
Comments
Wouldn't this,in long running systems, let obsolete (and potentially vulnerable) daemon running even if the user is thinking that their system is updated? |
Also,what software this is breaking exactly? |
I'm not sure I understand the question. Daemon (unit) would restart, only the socket wouldn't.
Any software that wants to have 100% uptime across changes. |
Thank you for your contributions.
|
With a lot of bells and whistles, yes. I'm not exactly doing what Domen is suggesting here but rather I'm restarting sockets and stopping associated services, both conditionally on what changed and how the units are configured. |
Now that I have a proper keyboard, it's roughly:
This may not work because there is a race in systemd that we cannot fix but we output a message if that happens. |
thanks for explaining! :) probably better to keep this open then until the race can be resolved somehow. |
The dbus api design of systemd makes it feel like this will never be resolved but we can wait for the stale bot to close this 🤷♂️ |
I marked this as stale due to inactivity. → More info |
As @domenkozar said, it indeed has a problem when restarting socket-activated services. The meaning of socket activation is:
If we restart the If I understand this code right, we are restarting all the IMHO, a better strategy should be:
Currently, I use a workaround to keep Generated # ...
[Socket]
Service=my-app.service # link to the service
# ... Generated # ...
[Unit]
After=network.target my-app-persistent.socket # link to the socket
BindsTo=my-app-persistent.socket # link to the socket
Requires=network.target my-app-persistent.socket # link to the socket
# ... The basic idea is to decouple the socket and service, so that Nix cannot directly analyze their This is ugly but works.
|
As mentioned in d37458a#diff-0a057d6ff3f6f83f68b859178484f4feR233,
I'd argue the current behavior of restarting sockets is wrong.
Motivation
One of the features of socket activation (per Lennart):
Existing behavior
If unit changes, socket is restarted along side the unit.
Expected behavior
If unit changes, socket is not restarted.
cc @abbradar
The text was updated successfully, but these errors were encountered: