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
nixos/switch-to-configuration: restart changed socket units #50340
Conversation
Previously, socket units wouldn't be restarted if they were changed. To restart the socket, the service the socket is attached to needs to be stopped first before the socket can be restarted.
795266e
to
c831e81
Compare
@GrahamcOfBorg test fcgiwrap systemd |
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: tests.fcgiwrap, tests.systemd Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: tests.fcgiwrap, tests.systemd Partial log (click to expand)
|
Tests work fine for me. Seems to be an ofborg glitch. cc @grahamc |
Success on x86_64-linux (full log) Attempted: fcgiwrap Partial log (click to expand)
|
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: fcgiwrap Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: fcgiwrap Partial log (click to expand)
|
For the ofborg problem: https://logs.nix.samueldr.com/nixos-borg/2018-11-13#1542105665-1542108034; (caused by #50233) |
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.
Overall LGTM!
addresses as defined in | ||
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | ||
</para> | ||
</listitem> |
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.
Should there also be a note about socket restarts in here?
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.
Hmm, yeah. you're right. Adding socking restart support is kind of a bugfix though. I'll add a paragraph.
socketMode = mkOption { | ||
type = types.str; | ||
default = "0660"; | ||
description = "File mode of the socket if it is defined as a Unix socket."; |
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.
I suggest we don't bikeshed this PR on this discussion, but…
Would it maybe make sense to make a socket
type which contains all these options, since it may well be used in multiple places? It doesn't seem that nice to have these settings which are essentially aliases for systemd.sockets.fcgiwrap.socketConfig.*
.
Are there any updates on this pull request, please? |
Done in #73871, fcgiwrap needs a new PR :) |
Motivation for this change
Previously, socket units wouldn't be restarted if they were changed. To restart the socket, the service the socket is attached to needs to be stopped first before the socket can be restarted.
Discovered while converting fcgiwrap to full socket activation support and writing a test for it. These changes are also part of this PR as is the test that checks using fcgiwrap if sockets are properly restarted.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)