Sometimes, debugging the kdump service failure becomes very challenging because there is no complete debugging information, which requires modification of the options or the scripts like kdumpctl, mkdumprd, etc to collect the information for troubleshooting.
That means users have to wait for the next failure so that they can capture the additional information, which could waste valuable time.
This patch series will add the debugging messages and save them to a file. It includes the following patches:
[1] [PATCH 1/2] kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file [2] [PATCH 2/2] kdumpctl: add the '-d' option to enable the kexec loading debugging messages
Lianbo Jiang (2): kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file kdumpctl: add the '-d' option to enable the kexec loading debugging messages
kdumpctl | 11 ++++++++++- mkdumprd | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
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@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""
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 --- kdumpctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index 83324cec72da..aab567a6f43a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -24,7 +24,7 @@ image_time=0 . $dracutbasedir/dracut-functions.sh . /lib/kdump/kdump-lib.sh
-standard_kexec_args="-p" +standard_kexec_args="-d -p"
# Some default values in case /etc/sysconfig/kdump doesn't include KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
On 8/11/20 3:01 PM, Lianbo Jiang wrote:
Sometimes, debugging the kdump service failure becomes very challenging because there is no complete debugging information, which requires modification of the options or the scripts like kdumpctl, mkdumprd, etc to collect the information for troubleshooting.
That means users have to wait for the next failure so that they can capture the additional information, which could waste valuable time.
This patch series will add the debugging messages and save them to a file. It includes the following patches:
[1] [PATCH 1/2] kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file [2] [PATCH 2/2] kdumpctl: add the '-d' option to enable the kexec loading debugging messages
Lianbo Jiang (2): kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file kdumpctl: add the '-d' option to enable the kexec loading debugging messages
kdumpctl | 11 ++++++++++- mkdumprd | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
Hello Lianbo,
I have three suggestions for the patch set:
[0x1] Set default log path to '/var/log/kdump' instead of '/var/crash'.
In my opinion, '/var/log/kdump' is more standard location than '/var/crash'.
[0x2] Add a timestamp to the debug log messages.
An end user can execute the 'kdumpctl' command multiple times and without a timestamp it would be difficult to read the messages from the log file.
[0x3] Print a message to differentiate between the kexec and mkdumprd log.
-- Buland
在 2020年08月11日 21:09, Buland Singh 写道:
On 8/11/20 3:01 PM, Lianbo Jiang wrote:
Sometimes, debugging the kdump service failure becomes very challenging because there is no complete debugging information, which requires modification of the options or the scripts like kdumpctl, mkdumprd, etc to collect the information for troubleshooting.
That means users have to wait for the next failure so that they can capture the additional information, which could waste valuable time.
This patch series will add the debugging messages and save them to a file. It includes the following patches:
[1] [PATCH 1/2] kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file [2] [PATCH 2/2] kdumpctl: add the '-d' option to enable the kexec loading debugging messages
Lianbo Jiang (2): kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file kdumpctl: add the '-d' option to enable the kexec loading debugging messages
kdumpctl | 11 ++++++++++- mkdumprd | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
Hello Lianbo,
I have three suggestions for the patch set:
[0x1] Set default log path to '/var/log/kdump' instead of '/var/crash'.
In my opinion, '/var/log/kdump' is more standard location than '/var/crash'.
[0x2] Add a timestamp to the debug log messages.
An end user can execute the 'kdumpctl' command multiple times and without a timestamp it would be difficult to read the messages from the log file.
[0x3] Print a message to differentiate between the kexec and mkdumprd log.
Thanks for your comment, Buland.
I will improve it in v2 based on your suggestion.
Thanks. Lianbo
-- Buland
Hi,
Let's continue to discuss it in the patch v2, will post it later.
Thanks. Lianbo
在 2020年08月11日 17:31, Lianbo Jiang 写道:
Sometimes, debugging the kdump service failure becomes very challenging because there is no complete debugging information, which requires modification of the options or the scripts like kdumpctl, mkdumprd, etc to collect the information for troubleshooting.
That means users have to wait for the next failure so that they can capture the additional information, which could waste valuable time.
This patch series will add the debugging messages and save them to a file. It includes the following patches:
[1] [PATCH 1/2] kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file [2] [PATCH 2/2] kdumpctl: add the '-d' option to enable the kexec loading debugging messages
Lianbo Jiang (2): kdumpctl/mkdumprd: add 'set -x' to output debugging information to a file kdumpctl: add the '-d' option to enable the kexec loading debugging messages
kdumpctl | 11 ++++++++++- mkdumprd | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)