]> git.ipfire.org Git - thirdparty/systemd.git/commit - units/systemd-tmpfiles-clean.service
units: add ordering dependencies on initrd-switch-root.target
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Sep 2022 11:39:10 +0000 (12:39 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 15 Sep 2022 12:59:11 +0000 (14:59 +0200)
commit7c0e2b555968d70ac563a37e32a6931ee90961a6
treea7262ff4b30c99fa410111e4505711c6e34d2c18
parentd5fd07cdeef104fdf4e1e1f9e60ff7ccb4669623
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.
units/ldconfig.service
units/systemd-ask-password-console.service
units/systemd-boot-system-token.service
units/systemd-network-generator.service.in
units/systemd-sysext.service
units/systemd-sysusers.service
units/systemd-tmpfiles-clean.service
units/systemd-tmpfiles-setup-dev.service
units/systemd-tmpfiles-setup.service