mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
switch-to-configuration-ng: Better handling of socket-activated units
Previously, if any unit had a socket associated with it, stc-ng counted it as "socket-activated", meaning that the unit would get stopped and the socket get restarted. That can wreak havoc on units like systemd-udevd and systemd-networkd. Instead, let units set the new flag notSocketActivated, which sets a boolean on the unit indicating to stc-ng that the unit wants to be treated like any other non-socket-activated unit instead. That will stop/start or restart these units on upgrades, without unnecessarily tearing down any machinery that the system needs to run.
This commit is contained in:
parent
5083ec8877
commit
bf9c6c9861
5 changed files with 28 additions and 2 deletions
|
@ -579,6 +579,8 @@ in rec {
|
|||
'' else "")
|
||||
+ optionalString (def ? stopIfChanged && !def.stopIfChanged) ''
|
||||
X-StopIfChanged=false
|
||||
'' + optionalString (def ? notSocketActivated && def.notSocketActivated) ''
|
||||
X-NotSocketActivated=true
|
||||
'' + attrsToSection def.serviceConfig);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue