diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-14 12:39:10 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-15 14:59:11 +0200 |
commit | 7c0e2b555968d70ac563a37e32a6931ee90961a6 (patch) | |
tree | a7262ff4b30c99fa410111e4505711c6e34d2c18 /units/ldconfig.service | |
parent | d5fd07cdeef104fdf4e1e1f9e60ff7ccb4669623 (diff) | |
download | systemd-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/ldconfig.service')
-rw-r--r-- | units/ldconfig.service | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/units/ldconfig.service b/units/ldconfig.service index cb887ae865..53c6d4ecb1 100644 --- a/units/ldconfig.service +++ b/units/ldconfig.service @@ -17,8 +17,8 @@ ConditionFileNotEmpty=|!/etc/ld.so.cache DefaultDependencies=no After=local-fs.target Before=sysinit.target systemd-update-done.service -Conflicts=shutdown.target -Before=shutdown.target +Conflicts=shutdown.target initrd-switch-root.target +Before=shutdown.target initrd-switch-root.target [Service] Type=oneshot |