]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units/initrd-parse-etc.service: Conflict with emergency.target
authorFabian Vogt <fvogt@suse.de>
Tue, 8 Aug 2023 10:52:53 +0000 (12:52 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 8 Aug 2023 19:24:39 +0000 (20:24 +0100)
If emergency.target is started while initrd-parse-etc.service/start is queued,
the initrd-parse-etc job did not get canceled. In parallel to the emergency
units, it eventually runs the service, which starts initrd-cleanup.service,
which in turn isolates initrd-switch-root.target. This stops the emergency
units and effectively starts the initrd boot process again, which likely
fails again like the initial attempt. The system is thus stuck in an endless
loop, never really reaching emergency.target.

With this conflict added, starting emergency.target automatically cancels
initrd-parse-etc.service/start, avoiding the loop.

units/initrd-parse-etc.service.in

index e592d3c2cb626edcff909974beb4183c914a32c0..3dadab112360814908e27d2613e66c905b73021f 100644 (file)
@@ -15,6 +15,8 @@ DefaultDependencies=no
 Requires=initrd-root-fs.target
 After=initrd-root-fs.target
 
+Conflicts=emergency.target
+
 OnFailure=emergency.target
 OnFailureJobMode=replace-irreversibly