summaryrefslogtreecommitdiff
path: root/units/systemd-network-generator.service.in
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-14 12:39:10 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-09-15 14:59:11 +0200
commit7c0e2b555968d70ac563a37e32a6931ee90961a6 (patch)
treea7262ff4b30c99fa410111e4505711c6e34d2c18 /units/systemd-network-generator.service.in
parentd5fd07cdeef104fdf4e1e1f9e60ff7ccb4669623 (diff)
downloadsystemd-7c0e2b555968d70ac563a37e32a6931ee90961a6.tar.gz
units: add ordering dependencies on initrd-switch-root.target
For shutdown, we queue shutdown.target/start, so in every unit which should be stopped *before* shutdown, we need both Conflicts and an ordering dependency with shutdown.target (either Before= or After= would work, because stop jobs are always ordered before start jobs). For initrd transition, we queue initrd-switch-root.service/isolate. This automatically creates a /stop job for every running unit without IgnoreOnIsolate. But no ordering dependency is created, unless the unit has a (possibly transitive) ordering dependency on initrd-switch-root.service. Since most units must stop before the transition, we should add the ordering dependency. It is nicer to use Before=initrd-switch-root.target for this. initrd-switch-root.target is ordered before initrd-switch-root.service, so the effect it the same when both are in a transaction. Fixes #23745. To also cover the case where somebody is emergency mode in the initrd and queues initrd-switch-root.service/start (not isolate), also add Conflicts=initrd-switch-root.target, so various units are stopped properly. This extends 2525682565b372b9b83c848bfe89c025fed47a1d to cover all the other services that are touched. It could be consider "operator error", but it's easy to make and it's nicer if we can make this more foolproof.
Diffstat (limited to 'units/systemd-network-generator.service.in')
-rw-r--r--units/systemd-network-generator.service.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/units/systemd-network-generator.service.in b/units/systemd-network-generator.service.in
index 41c27c50d8..2b79ca6b8a 100644
--- a/units/systemd-network-generator.service.in
+++ b/units/systemd-network-generator.service.in
@@ -14,8 +14,8 @@ Documentation=man:systemd-network-generator.service(8)
DefaultDependencies=no
Before=network-pre.target systemd-udevd.service
Wants=network-pre.target
-Conflicts=shutdown.target
-Before=shutdown.target
+Conflicts=shutdown.target initrd-switch-root.target
+Before=shutdown.target initrd-switch-root.target
[Service]
Type=oneshot