From cc4abf52c9c8fc0099dc9dd8b281f67866ed56b5 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Fri, 2 Aug 2013 14:52:32 +0800 Subject: [PATCH] Use /lib/dracut/no-emergency-shell to control action on fail Currently when action_on_fail is enabled, the emergency_shell won't be called either. In kdump even though user specify the default action as emergency_shell, dracut still skip it. Now change the implementation of action_on_fail to depend on a file which is created by kdump when making kdump initrd, then remove it at the beginning of kdump. This can solve the explicit emergency_shell problem. Signed-off-by: Baoquan He Acked-by: Vivek Goyal Acked-by: WANG Chao --- dracut-kdump.sh | 4 ++++ dracut-module-setup.sh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/dracut-kdump.sh b/dracut-kdump.sh index 8a6a3a4..4852884 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -3,6 +3,10 @@ exec &> /dev/console . /lib/dracut-lib.sh +if [ -f "$initdir/lib/dracut/no-emergency-shell" ]; then + rm -f -- $initdir/lib/dracut/no-emergency-shell +fi + set -o pipefail KDUMP_PATH="/var/crash" CORE_COLLECTOR="" diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 725eecf..41492b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -400,6 +400,8 @@ kdump_check_iscsi_targets () { install() { kdump_install_conf + >"$initdir/lib/dracut/no-emergency-shell" + if is_ssh_dump_target; then dracut_install /var/lib/random-seed || exit $? fi