mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
5d6ea734a1
This essentially backports https://github.com/systemd/systemd/pull/27791. `systemd-networkd.service` is sent the `SIGTERM` signal, but it is not required to be stopped before `initrd-switch-root.target` is reached, despite the use of `systemctl isolate initrd-switch-root.target`. This is because when there is no ordering at all between two units, and a transaction stops one and starts the other, the two operations can happen simultaneously. This means the service could still be running when `switch-root` actually occurs. Then, stage 2 systemd will see the service still running and decide it doesn't need to add a start operation for it to its initial transaction. Finally, the service exits, but only after it's already too late. If, however, there is any ordering at all between a stopping unit and a starting unit, then the stop operation will be done first. This way, we ensure that the service is properly exited before doing `switch-root`. This is something to keep in mind going forward. There may be other services that need this treatment. These `before` and `conflicts` definitions are the correct way to ensure a unit is actually stopped before you reach initrd-switch-root |
||
---|---|---|
.. | ||
activation | ||
boot | ||
etc | ||
build.nix |