From e5ccb87ef6b6e37fbca4133d288e8f8a73b84022 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Mon, 26 Apr 2021 17:09:55 +0800 Subject: [PATCH] Don's try to restart dracut-initqueue if it's already there Resolves: bz1901024 Upstream: Fedora Conflict: None commit 108258139a24b596be454c9aaa07b6ebf96e49a1 Author: Kairui Song Date: Mon Apr 26 17:09:55 2021 +0800 Don's try to restart dracut-initqueue if it's already there kdump's dump_to_rootfs will try to start initqueue unconditionally. dump_to_rootfs will run after systemd isolate to emergency target, so this is currently accetable. But there is a problem when initqueue starts the emergency action because of initqueue timeout. dump_to_rootfs will start initqueue and lead to timeout again. So following patch will remove the previous isolation wrapper, and detect the service status here. Previous isolation makes the detection impossible. Now this detection will be valid and helpful to prevent double timeout or hang. Signed-off-by: Kairui Song Acked-by: Coiby Xu Signed-off-by: Kairui Song --- kdump-lib-initramfs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index d0d124f..e359a15 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -222,8 +222,11 @@ save_opalcore_fs() { dump_to_rootfs() { - dinfo "Trying to bring up rootfs device" - systemctl start dracut-initqueue + if [[ $(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p") == "inactive" ]]; then + dinfo "Trying to bring up initqueue for rootfs mount" + systemctl start dracut-initqueue + fi + dinfo "Waiting for rootfs mount, will timeout after 90 seconds" systemctl start sysroot.mount