ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ff2b41
From d6f32f9063f5e7bb7864fb6be014a52e6036b111 Mon Sep 17 00:00:00 2001
ff2b41
From: Franck Bui <fbui@suse.com>
ff2b41
Date: Mon, 28 Jan 2019 12:07:37 +0100
ff2b41
Subject: [PATCH] units: make sure initrd-cleanup.service terminates before
ff2b41
 switching to rootfs
ff2b41
ff2b41
A follow-up for commit a8cb1dc3e0fa81aff.
ff2b41
ff2b41
Commit a8cb1dc3e0fa81aff made sure that initrd-cleanup.service won't be stopped
ff2b41
when initrd-switch-root.target is isolated.
ff2b41
ff2b41
However even with this change, it might happen that initrd-cleanup.service
ff2b41
survives the switch to rootfs (since it has no ordering constraints against
ff2b41
initrd-switch-root.target) and is stopped right after when default.target is
ff2b41
isolated. This led to initrd-cleanup.service entering in failed state as it
ff2b41
happens when oneshot services are stopped.
ff2b41
ff2b41
This patch along with a8cb1dc3e0fa81aff should fix issue #4343.
ff2b41
ff2b41
Fixes: #4343
ff2b41
(cherry picked from commit e2c7c94ea35fe7e669afb51bfc2251158b522ea5)
ff2b41
ff2b41
Related: #1560417
ff2b41
---
ff2b41
 units/initrd-switch-root.target | 2 +-
ff2b41
 1 file changed, 1 insertion(+), 1 deletion(-)
ff2b41
ff2b41
diff --git a/units/initrd-switch-root.target b/units/initrd-switch-root.target
ff2b41
index 934d82f667..ada5b9e7fd 100644
ff2b41
--- a/units/initrd-switch-root.target
ff2b41
+++ b/units/initrd-switch-root.target
ff2b41
@@ -13,4 +13,4 @@ Requires=initrd-switch-root.service
ff2b41
 Before=initrd-switch-root.service
ff2b41
 AllowIsolate=yes
ff2b41
 Wants=initrd-udevadm-cleanup-db.service initrd-root-fs.target initrd-fs.target systemd-journald.service initrd-cleanup.service
ff2b41
-After=initrd-udevadm-cleanup-db.service initrd-root-fs.target initrd-fs.target emergency.service emergency.target
ff2b41
+After=initrd-udevadm-cleanup-db.service initrd-root-fs.target initrd-fs.target emergency.service emergency.target initrd-cleanup.service