User complains that kdump_post script doesn't execute after mount failed. This happened since mount failure will trigger kdump-error-handler.service, and then start kdump-error-handler.sh. However in kdump-error-handler.sh it doesn't execute kdump_post. Hence add it in this patch.
Surely the function do_kdump_post need be moved into kdump-lib-initramfs.sh to be a common function.
v1->v2: Add a return value to do_kdump_post when invoked in kdump_error-handler.sh. And call do_kdump_post earlier than do_default_action, otherwise it may not execute if reboot/poweroff/halt.
Signed-off-by: Baoquan He bhe@redhat.com --- dracut-kdump-error-handler.sh | 1 + dracut-kdump.sh | 7 ------- kdump-lib-initramfs.sh | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dracut-kdump-error-handler.sh b/dracut-kdump-error-handler.sh index 2f0f1d1..e0c6724 100755 --- a/dracut-kdump-error-handler.sh +++ b/dracut-kdump-error-handler.sh @@ -6,5 +6,6 @@ set -o pipefail export PATH=$PATH:$KDUMP_SCRIPT_DIR
get_kdump_confs +do_kdump_post 1 do_default_action do_final_action diff --git a/dracut-kdump.sh b/dracut-kdump.sh index e062665..fa8908f 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -35,13 +35,6 @@ do_kdump_pre() fi }
-do_kdump_post() -{ - if [ -n "$KDUMP_POST" ]; then - "$KDUMP_POST" "$1" - fi -} - add_dump_code() { DUMP_INSTRUCTION=$1 diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 57b8304..9f26f6c 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -161,3 +161,10 @@ do_final_action() { eval $FINAL_ACTION } + +do_kdump_post() +{ + if [ -n "$KDUMP_POST" ]; then + "$KDUMP_POST" "$1" + fi +}
On 02/09/15 at 03:49pm, Baoquan He wrote:
User complains that kdump_post script doesn't execute after mount failed. This happened since mount failure will trigger kdump-error-handler.service, and then start kdump-error-handler.sh. However in kdump-error-handler.sh it doesn't execute kdump_post. Hence add it in this patch.
Surely the function do_kdump_post need be moved into kdump-lib-initramfs.sh to be a common function.
v1->v2: Add a return value to do_kdump_post when invoked in kdump_error-handler.sh. And call do_kdump_post earlier than do_default_action, otherwise it may not execute if reboot/poweroff/halt.
Signed-off-by: Baoquan He bhe@redhat.com
dracut-kdump-error-handler.sh | 1 + dracut-kdump.sh | 7 ------- kdump-lib-initramfs.sh | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dracut-kdump-error-handler.sh b/dracut-kdump-error-handler.sh index 2f0f1d1..e0c6724 100755 --- a/dracut-kdump-error-handler.sh +++ b/dracut-kdump-error-handler.sh @@ -6,5 +6,6 @@ set -o pipefail export PATH=$PATH:$KDUMP_SCRIPT_DIR
get_kdump_confs +do_kdump_post 1 do_default_action do_final_action diff --git a/dracut-kdump.sh b/dracut-kdump.sh index e062665..fa8908f 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -35,13 +35,6 @@ do_kdump_pre() fi }
-do_kdump_post() -{
- if [ -n "$KDUMP_POST" ]; then
"$KDUMP_POST" "$1"
- fi
-}
add_dump_code() { DUMP_INSTRUCTION=$1 diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 57b8304..9f26f6c 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -161,3 +161,10 @@ do_final_action() { eval $FINAL_ACTION }
+do_kdump_post() +{
- if [ -n "$KDUMP_POST" ]; then
"$KDUMP_POST" "$1"
- fi
+}
It looks good to me.
Acked-by: Minfei Huang mhuang@redhat.com
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 02/09/15 at 03:49pm, Baoquan He wrote:
User complains that kdump_post script doesn't execute after mount failed. This happened since mount failure will trigger kdump-error-handler.service, and then start kdump-error-handler.sh. However in kdump-error-handler.sh it doesn't execute kdump_post. Hence add it in this patch.
Surely the function do_kdump_post need be moved into kdump-lib-initramfs.sh to be a common function.
v1->v2: Add a return value to do_kdump_post when invoked in kdump_error-handler.sh. And call do_kdump_post earlier than do_default_action, otherwise it may not execute if reboot/poweroff/halt.
Signed-off-by: Baoquan He bhe@redhat.com
dracut-kdump-error-handler.sh | 1 + dracut-kdump.sh | 7 ------- kdump-lib-initramfs.sh | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dracut-kdump-error-handler.sh b/dracut-kdump-error-handler.sh index 2f0f1d1..e0c6724 100755 --- a/dracut-kdump-error-handler.sh +++ b/dracut-kdump-error-handler.sh @@ -6,5 +6,6 @@ set -o pipefail export PATH=$PATH:$KDUMP_SCRIPT_DIR
get_kdump_confs +do_kdump_post 1 do_default_action do_final_action diff --git a/dracut-kdump.sh b/dracut-kdump.sh index e062665..fa8908f 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -35,13 +35,6 @@ do_kdump_pre() fi }
-do_kdump_post() -{
- if [ -n "$KDUMP_POST" ]; then
"$KDUMP_POST" "$1"
- fi
-}
add_dump_code() { DUMP_INSTRUCTION=$1 diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh index 57b8304..9f26f6c 100755 --- a/kdump-lib-initramfs.sh +++ b/kdump-lib-initramfs.sh @@ -161,3 +161,10 @@ do_final_action() { eval $FINAL_ACTION }
+do_kdump_post() +{
- if [ -n "$KDUMP_POST" ]; then
"$KDUMP_POST" "$1"
- fi
+}
1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
ACK
Thanks Dave