From da6b280a633cf09bb7dcdf1dc1288488a4093e47 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Jul 20 2021 07:12:55 +0000 Subject: Cleanup dead systemd services before start sysroot.mount Resolves: bz1972463 Conflict: None Upstream: Fedora commit 2603ba71878f73ffa0608cb9c855da398c4132c1 (origin/rawhide, rawhide) Author: Kairui Song Date: Fri Jul 2 03:27:05 2021 +0800 Cleanup dead systemd services before start sysroot.mount When kdump failed due to initqueue timeout, the sysroot.mount and other serivces could be stuck in `start` but `dead` status: Example output of systemctl: dev-disk-by\x2duuid-530830d1\x2df2c7\x2d4c9a\x2d9a82\x2d148609097521.device loaded inactive dead start <... snip ...> squash-root.mount loaded active mounted /squash/root squash.mount loaded active mounted /squash sysroot.mount loaded inactive dead start /sysroot <... snip ...> dracut-cmdline.service loaded active exited dracut cmdline hook dracut-initqueue.service loaded activating start start dracut initqueue hook dracut-mount.service loaded inactive dead start dracut mount hook At this point calling `systemctl start sysroot.mount` will just hang as systemd will just wait for the services that are stuck in `start` status. So call `systemctl cancel` here to cancel all pending jobs and have a clean start for mounting sysroot. Signed-off-by: Kairui Song Acked-by: Coiby Xu Signed-off-by: Kairui Song --- diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index ca6a825..4cd18e4 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -227,6 +227,8 @@ dump_to_rootfs() systemctl start dracut-initqueue fi + dinfo "Clean up dead systemd services" + systemctl cancel dinfo "Waiting for rootfs mount, will timeout after 90 seconds" systemctl start sysroot.mount