kdumpctl: add the '-d' option to enable the kexec loading debugging messages
Currently, the kexec option '--debug/-d' is not enabled by default, which means that users need to set it manually and wait for the next failure to capture the additional information. Therefore, let's enable the option '-d' for kexec loading by default. Signed-off-by: Lianbo Jiang <lijiang@redhat.com> Acked-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
parent
d001bd177f
commit
88a8b94de9
17
kdumpctl
17
kdumpctl
@ -6,6 +6,7 @@ KDUMP_KERNEL=""
|
|||||||
KDUMP_COMMANDLINE=""
|
KDUMP_COMMANDLINE=""
|
||||||
KEXEC_ARGS=""
|
KEXEC_ARGS=""
|
||||||
KDUMP_CONFIG_FILE="/etc/kdump.conf"
|
KDUMP_CONFIG_FILE="/etc/kdump.conf"
|
||||||
|
KDUMP_LOG_PATH="/var/log"
|
||||||
MKDUMPRD="/sbin/mkdumprd -f"
|
MKDUMPRD="/sbin/mkdumprd -f"
|
||||||
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
|
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
|
||||||
SAVE_PATH=/var/crash
|
SAVE_PATH=/var/crash
|
||||||
@ -21,7 +22,7 @@ FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered"
|
|||||||
DEFAULT_DUMP_MODE="kdump"
|
DEFAULT_DUMP_MODE="kdump"
|
||||||
image_time=0
|
image_time=0
|
||||||
|
|
||||||
standard_kexec_args="-p"
|
standard_kexec_args="-d -p"
|
||||||
|
|
||||||
# Some default values in case /etc/sysconfig/kdump doesn't include
|
# Some default values in case /etc/sysconfig/kdump doesn't include
|
||||||
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
|
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
|
||||||
@ -704,6 +705,8 @@ check_rebuild()
|
|||||||
# as the currently running kernel.
|
# as the currently running kernel.
|
||||||
load_kdump()
|
load_kdump()
|
||||||
{
|
{
|
||||||
|
local ret
|
||||||
|
|
||||||
KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}")
|
KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}")
|
||||||
KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}")
|
KDUMP_COMMANDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}")
|
||||||
|
|
||||||
@ -717,10 +720,20 @@ load_kdump()
|
|||||||
|
|
||||||
ddebug "$KEXEC $KEXEC_ARGS $standard_kexec_args --command-line=$KDUMP_COMMANDLINE --initrd=$TARGET_INITRD $KDUMP_KERNEL"
|
ddebug "$KEXEC $KEXEC_ARGS $standard_kexec_args --command-line=$KDUMP_COMMANDLINE --initrd=$TARGET_INITRD $KDUMP_KERNEL"
|
||||||
|
|
||||||
|
exec 12>&2
|
||||||
|
exec 2>> $KDUMP_LOG_PATH/kdump.log
|
||||||
|
PS4='+ $(date "+%Y-%m-%d %H:%M:%S") ${BASH_SOURCE}@${LINENO}: '
|
||||||
|
set -x
|
||||||
|
|
||||||
$KEXEC $KEXEC_ARGS $standard_kexec_args \
|
$KEXEC $KEXEC_ARGS $standard_kexec_args \
|
||||||
--command-line="$KDUMP_COMMANDLINE" \
|
--command-line="$KDUMP_COMMANDLINE" \
|
||||||
--initrd=$TARGET_INITRD $KDUMP_KERNEL
|
--initrd=$TARGET_INITRD $KDUMP_KERNEL
|
||||||
if [ $? == 0 ]; then
|
|
||||||
|
ret=$?
|
||||||
|
set +x
|
||||||
|
exec 2>&12 12>&-
|
||||||
|
|
||||||
|
if [ $ret == 0 ]; then
|
||||||
dinfo "kexec: loaded kdump kernel"
|
dinfo "kexec: loaded kdump kernel"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user