[kexec-tools] Use /lib/dracut/no-emergency-shell to control action on fail

Baoquan He baoquan at fedoraproject.org
Fri Aug 2 07:33:50 UTC 2013


commit cc4abf52c9c8fc0099dc9dd8b281f67866ed56b5
Author: Baoquan He <bhe at redhat.com>
Date:   Fri Aug 2 14:52:32 2013 +0800

    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 <bhe at redhat.com>
    Acked-by: Vivek Goyal <vgoyal at redhat.com>
    Acked-by: WANG Chao <chaowang at redhat.com>

 dracut-kdump.sh        |    4 ++++
 dracut-module-setup.sh |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
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


More information about the scm-commits mailing list