Sometimes, debugging the kdump service failure becomes very challenging
because there is no additional debugging information, which requires
modification of the scripts like kdumpctl, mkdumprd, etc to collect the
information for troubleshooting.
In view of this, add 'set -x' in the scripts in order to get the complete
debugging information.
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
kdumpctl | 9 +++++++++
mkdumprd | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 122e065b8c69..83324cec72da 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,6 +5,7 @@ KDUMP_KERNELVER=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
+KDUMP_LOG_PATH="/var/crash"
MKDUMPRD="/sbin/mkdumprd -f"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
SAVE_PATH=/var/crash
@@ -32,6 +33,14 @@ if [ -f /etc/sysconfig/kdump ]; then
. /etc/sysconfig/kdump
fi
+if [ ! -d $KDUMP_LOG_PATH ]; then
+ mkdir -p $KDUMP_LOG_PATH
+fi
+
+#redirect stderr and apend debugging messages to a file
+exec 2>> $KDUMP_LOG_PATH/kdump.log
+set -x
+
single_instance_lock()
{
local rc timeout=5
diff --git a/mkdumprd b/mkdumprd
index 91ce3d5a0686..2d21b807e9e2 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -15,6 +15,15 @@ conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
+KDUMP_LOG_PATH="/var/crash"
+
+if [ ! -d $KDUMP_LOG_PATH ]; then
+ mkdir -p $KDUMP_LOG_PATH
+fi
+
+#redirect stderr and apend debugging messages to a file
+exec 2>> $KDUMP_LOG_PATH/kdump.log
+set -x
extra_modules=""
dracut_args="--quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode
strict -o \"plymouth dash resume ifcfg earlykdump\""
--
2.17.1