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 kasong@redhat.com ---
This patch is from patch series: [PATCH 0/2] Fix kdump hang when failure_action is dump_to_rootfs It turns out PATCH 1/2 of that patch series is not needed.
kdump-lib-initramfs.sh | 2 ++ 1 file changed, 2 insertions(+)
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
On Thu, Jul 08, 2021 at 01:42:27PM +0800, Kairui Song wrote:
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 kasong@redhat.com
This patch is from patch series: [PATCH 0/2] Fix kdump hang when failure_action is dump_to_rootfs It turns out PATCH 1/2 of that patch series is not needed.
kdump-lib-initramfs.sh | 2 ++ 1 file changed, 2 insertions(+)
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
-- 2.31.1
It looks good to me.
Acked-by: Coiby Xu coxu@redhat.com