From 39352d0cfc98b43ce60ac262b6fc4dd5c6e084dd Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 30 Oct 2019 17:09:07 +0800 Subject: [PATCH] Don't execute final_action if failure_action terminates the system If failure_action is shutdown/reboot/halt, final_action is pointless as the system will be already stopping. And if final_action is different from failure_action, it will trigger a systemd race problem and cause unexpected behavior to occur. So let the error handler stop and exit after performing failure_action successfully if failure_action is one of shutdown/reboot/halt. This way, final_action will not be executed. Signed-off-by: Kairui Song Acked-by: Pingfan Liu --- kdump-lib-initramfs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index c409dce..8530556 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -56,13 +56,13 @@ get_kdump_confs() FAILURE_ACTION="kdump_emergency_shell" ;; reboot) - FAILURE_ACTION="systemctl reboot -f" + FAILURE_ACTION="systemctl reboot -f && exit" ;; halt) - FAILURE_ACTION="halt" + FAILURE_ACTION="halt && exit" ;; poweroff) - FAILURE_ACTION="systemctl poweroff -f" + FAILURE_ACTION="systemctl poweroff -f && exit" ;; dump_to_rootfs) FAILURE_ACTION="dump_to_rootfs"