[PATCHv2 0/4] trival fixes and improvement of pre.d/post.d hooks
by Pingfan Liu
v1 -> v2:
1. [1/4]: using rpm spec to install pre.d and post.d mandatory
2. [4/4]: improve commit log
Pingfan Liu (4):
kdumpctl: make the existence of pre.d and post.d mandatory
kdumpctl: rely on the timestamp of scripts' directory to tell
modification
kdumpctl: remove executable checking on pre.d and post.d
module-setup.sh: suppress false alarm
dracut-module-setup.sh | 4 ++--
kdumpctl | 6 ++++--
kexec-tools.spec | 6 ++++++
3 files changed, 12 insertions(+), 4 deletions(-)
--
2.25.4
3 years, 9 months
[PATCH] kdump_pre: make notes more precise
by Pingfan Liu
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
dracut-kdump.sh | 1 +
kdump.conf | 2 +-
kdump.conf.5 | 2 +-
kexec-kdump-howto.txt | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index c74c4b7..6f948fc 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -41,6 +41,7 @@ do_kdump_pre()
fi
fi
+ # if any script fails, it just raises warning and continues
if [ -d /etc/kdump/pre.d ]; then
for file in /etc/kdump/pre.d/*; do
"$file"
diff --git a/kdump.conf b/kdump.conf
index ed78507..9f35e31 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -89,7 +89,7 @@
# after the dump process, runs immediately before it.
# Exit status of this binary is interpreted as follows:
# 0 - continue with dump process as usual
-# non 0 - reboot the system
+# non 0 - run the final action (reboot/poweroff/halt)
# If /etc/kdump/pre.d directory exists, all files in
# the directory are collectively sorted and executed in
# lexical order, after binary or script specified
diff --git a/kdump.conf.5 b/kdump.conf.5
index 9f2b2b6..c362963 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -127,7 +127,7 @@ as follows:
.PP
0 - continue with dump process as usual
.PP
-non 0 - reboot the system
+non 0 - run the final action (reboot/poweroff/halt)
.PP
If /etc/kdump/pre.d directory exists, all files in
the directory are collectively sorted and executed in
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 9b0fee2..2209e5a 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -553,7 +553,7 @@ Kdump Pre-Capture Executable
It is possible to specify a custom script or binary you wish to run before
capturing a vmcore. Exit status of this binary is interpreted:
0 - continue with dump process as usual
-non 0 - reboot the system
+non 0 - run the final action (reboot/poweroff/halt)
If /etc/kdump/pre.d directory exists, all files in the directory are collectively
sorted and executed in lexical order, after binary or script specified
kdump_pre parameter is executed.
--
2.7.5
3 years, 9 months
[PATCH] dracut-kdump.sh: exit shell when machine reboot
by Pingfan Liu
The following scenario is observed:
kdump: kdump_pre script exited with non-zero status!
[ 5.104841] systemd[1]: Shutting down.
[ 5.122162] printk: systemd-shutdow: 27 output lines suppressed due to ratelimiting
kdump: dump target is /dev/mapper/rhel_hpe--dl380pgen8--02--vm--12-root
kdump: saving to /sysroot//var/crash/127.0.0.1-2020-06-27-03:55:01/
kdump: saving vmcore-dmesg.txt
kdump: saving vmcore-dmesg.txt complete
kdump: saving vmcore
Checking for memory holes : [ 0.0 %] / Checking for memory holes : [100.0 %] | [ 5.516573] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 5.519515] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
It is caused by the following script
if [ $? -ne 0 ]; then
echo "kdump: kdump_pre script exited with non-zero status!"
do_final_action
fi
When do_final_action runs, a systemd service is forked for reboot, then the
subshell returns, and parent continues to execute. Place "exit 1" to stop
executing and make kdump service failure.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
dracut-kdump.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b71278d..c74c4b7 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -251,6 +251,8 @@ do_kdump_pre
if [ $? -ne 0 ]; then
echo "kdump: kdump_pre script exited with non-zero status!"
do_final_action
+ # During systemd service to reboot the machine, stop this shell script running
+ exit 1
fi
make_trace_mem "kdump saving vmcore" '1:shortmem' '2+:mem' '3+:slab'
do_dump
--
2.7.5
3 years, 9 months
[PATCH 0/5] trival fixes and improvement of pre.d/post.d hooks
by Pingfan Liu
Pingfan Liu (5):
kdump.conf: fix grammar
kdumpctl: make the existence of pre.d and post.d mandatory
kdumpctl: rely on the timestamp of scripts' directory to tell
modification
kdumpctl: remove executable checking on pre.d and post.d
module-setup.sh: suppress false alarm
dracut-module-setup.sh | 4 ++--
kdump.conf | 2 +-
kdumpctl | 24 ++++++++++--------------
3 files changed, 13 insertions(+), 17 deletions(-)
--
2.7.5
3 years, 9 months
[PATCH 0/4] use the option KEXEC_ARGS="-s" to enable the kexec file load
by Lianbo Jiang
This series includes four patches:
[1] Revert "kdump-lib: switch to the kexec_file_load() syscall on x86_64 by default"
[2] Revert "s390x: add kdump sysconfig option to use the kexec_file_load() syscall"
[3] x86_64: enable the kexec file load by default
[4] s390x: enable the kexec file load by default
Let's restore the logic of secureboot status check, and remove the
option 'KDUMP_FILE_LOAD=on|off'. We will use the option KEXEC_ARGS="-s"
to enable the kexec file load by default, which can avoid failures when
the secureboot is enabled.
Lianbo Jiang (4):
Revert "kdump-lib: switch to the kexec_file_load() syscall on x86_64
by default"
Revert "s390x: add kdump sysconfig option to use the kexec_file_load()
syscall"
x86_64: enable the kexec file load by default
s390x: enable the kexec file load by default
dracut-early-kdump.sh | 5 ++---
kdump-lib.sh | 29 +++++++++++++++++++++++++++++
kdump.sysconfig.s390x | 8 +-------
kdump.sysconfig.x86_64 | 8 +-------
kdumpctl | 13 ++++++-------
5 files changed, 39 insertions(+), 24 deletions(-)
--
2.17.1
3 years, 9 months