nixpkgs/nixos/modules/system/activation
Janne Heß 3052d3aa50
nixos/switch-to-configuration: Fix restarting by activation script
This bug is so obscure and unlikely that I was honestly not able to
properly write a test for it. What happens is that we are calling
handleModifiedUnit() with $unitsToStart=\%unitsToRestart. We do this to
make sure that the unit is stopped before it's started again which is
not possible by regular means because the stop phase is already done
when calling the activation script.

recordUnit() still gets $startListFile, however which is the wrong file.
The bug would be triggered if an activation script requests a service
restart for a service that has `stopIfChanged = true` and
switch-to-configuration is killed before the restart phase was run. If
the script is run again, but the activation script is not requesting
more restarts, the unit would be started instead of restarted.
2022-03-11 13:30:03 +01:00
..
activation-script.nix nixos/activation-script: ensure gcroots dir exists 2022-01-20 20:24:32 +00:00
no-clone.nix specialisation: replace nesting with named configurations 2020-04-12 08:12:50 -04:00
switch-to-configuration.pl nixos/switch-to-configuration: Fix restarting by activation script 2022-03-11 13:30:03 +01:00
top-level.nix nixos/switch-to-configuration: avoid Array::Compare dependency 2022-02-15 15:37:37 +01:00