nixos/switch-to-configuration: restart changed socket units #50340
nixos/switch-to-configuration: restart changed socket units #50340fpletz wants to merge 3 commits intoNixOS:masterfrom
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) |
| addresses as defined in | ||
| <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | ||
| </para> | ||
| </listitem> |
There was a problem hiding this comment.
Should there also be a note about socket restarts in here?
There was a problem hiding this comment.
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.
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
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)