[PATCH] mkdumprd: allow spaces after 'path' config phrase when network dump
by Kazuhito Hagio
Without this patch, when there are two or more spaces after 'path'
configuration phrase with ssh or nfs setting, SAVE_PATH is set to
'/var/crash' in mkdumprd, and in most cases kdump service fails to
start.
ssh kdump(a)192.168.122.1
path /kdump
^^
This behavior would be too sensitive and different from the other
configurations. With this patch, mkdumprd allows such spaces.
Signed-off-by: Kazuhito Hagio <k-hagio(a)ab.jp.nec.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index a6f7fe8..aa0abfd 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -13,7 +13,7 @@ export IN_KDUMP=1
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
-SAVE_PATH=$(grep ^path $conf_file| cut -d' ' -f2)
+SAVE_PATH=$(awk '/^path/ {print $2}' $conf_file)
[ -z "$SAVE_PATH" ] && SAVE_PATH=$DEFAULT_PATH
# strip the duplicated "/"
SAVE_PATH=$(echo $SAVE_PATH | tr -s /)
--
2.18.0
1 year, 6 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, 5 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, 5 months
[PATCH] mkdumprd: Improve the error message for umounted dump target
by Kairui Song
Since commit ca01cbd, mkdumprd can generate the initramfs even if dump
target is not mounted. But it will refuse to work if the dump target is
not marked as noauto, and not mounted.
If a target is not marked as noauto in fstab, it should be mounted
automatically on boot. If it's not mounted, most likely something is
wrong and user should fix that. So mkdumprd will just show an error
message and quit to avoid further failure.
This commit make the error message more clear and less confusing.
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index bf816fc..0965cb4 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -222,7 +222,7 @@ check_user_configured_target()
[ $? -ne 0 ] && perror_exit "Failed to mount $_target on $_mnt for kdump preflight check."
_mounted=$_mnt
else
- perror_exit "$_target is configured in fstab but not mounted, please check its usability."
+ perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
fi
fi
else
--
2.26.2
3 years, 5 months
[PATCHv2] man: improve description about /etc/kdump/{pre.d,post.d}interface
by Pingfan Liu
The description is identical to the notes in kdump.conf
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
v1 -> v2: grammar fix: s/is exist/exists/
kdump.conf.5 | 12 ++++++++++++
kexec-kdump-howto.txt | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/kdump.conf.5 b/kdump.conf.5
index 5a0952b..9f2b2b6 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,6 +109,11 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
+If /etc/kdump/post.d directory exists, All files in
+the directory are collectively sorted and executed in
+lexical order, before binary or script specified
+kdump_post parameter is executed.
+.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
.RE
@@ -124,6 +129,13 @@ as follows:
.PP
non 0 - reboot the system
.PP
+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.
+Even if the binary or script in /etc/kdump/pre.d directory
+returns non 0 exit status, the processing is continued.
+.PP
Note that scripts written for this directive must use
the /bin/bash interpreter.
.RE
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 78ebf69..9b0fee2 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -543,6 +543,9 @@ It is possible to specify a custom script or binary you wish to run following
an attempt to capture a vmcore. The executable is passed an exit code from
the capture process, which can be used to trigger different actions from
within your post-capture executable.
+If /etc/kdump/post.d directory exist, All files in the directory are
+collectively sorted and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
Kdump Pre-Capture Executable
----------------------------
@@ -551,6 +554,11 @@ 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
+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.
+Even if the binary or script in /etc/kdump/pre.d directory returns non 0
+exit status, the processing is continued.
Extra Binaries
--------------
--
2.7.5
3 years, 5 months
[PATCH v2 0/2] Fix kdump issues with UUID= or LABEL= config style
by Kairui Song
Previous patch series:
[PATCH v2 0/7] Add support for unmounted dump target
assumed get_persistent_dev accepts any block target config format. But
it doesn't recognize the UUID= or LABEL= format. So always use the
wrapper version for kdump which supports it well.
Also fix a nfs detection issue introduced the that patch series.
Kairui Song (2):
Always wrap up call to dracut get_persistent_dev function
mkdumprd: Fix nfs detection in to_mount
Update from v1:
- Keep kdump_get_persistent_dev function name unchanged
- Simplify and fix nfs dump target detection in to_mount again
dracut-module-setup.sh | 14 --------------
kdump-lib.sh | 14 ++++++++++++++
kdumpctl | 2 +-
mkdumprd | 24 ++++++++++--------------
4 files changed, 25 insertions(+), 29 deletions(-)
--
2.26.2
3 years, 5 months
[PATCH] man: improve description about /etc/kdump/{pre.d,post.d}interface
by Pingfan Liu
The description is identical to the notes in kdump.conf
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf.5 | 12 ++++++++++++
kexec-kdump-howto.txt | 8 ++++++++
2 files changed, 20 insertions(+)
diff --git a/kdump.conf.5 b/kdump.conf.5
index 5a0952b..e275662 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -109,6 +109,11 @@ status of the current dump process is fed to the kdump_post
executable as its first argument($1). Executable can modify
it to indicate the new exit status of succeeding dump process,
.PP
+If /etc/kdump/post.d directory is exist, All files in
+the directory are collectively sorted and executed in
+lexical order, before binary or script specified
+kdump_post parameter is executed.
+.PP
Note that scripts written for use with this directive must use
the /bin/bash interpreter.
.RE
@@ -124,6 +129,13 @@ as follows:
.PP
non 0 - reboot the system
.PP
+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.
+Even if the binary or script in /etc/kdump/pre.d directory
+returns non 0 exit status, the processing is continued.
+.PP
Note that scripts written for this directive must use
the /bin/bash interpreter.
.RE
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 78ebf69..bb905d3 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -543,6 +543,9 @@ It is possible to specify a custom script or binary you wish to run following
an attempt to capture a vmcore. The executable is passed an exit code from
the capture process, which can be used to trigger different actions from
within your post-capture executable.
+If /etc/kdump/post.d directory is exist, All files in the directory are
+collectively sorted and executed in lexical order, before binary or script
+specified kdump_post parameter is executed.
Kdump Pre-Capture Executable
----------------------------
@@ -551,6 +554,11 @@ 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
+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.
+Even if the binary or script in /etc/kdump/pre.d directory returns non 0
+exit status, the processing is continued.
Extra Binaries
--------------
--
2.7.5
3 years, 5 months
[PATCH 0/2] Fix kdump issues with UUID= or LABEL= config style
by Kairui Song
Previous patch series:
[PATCH v2 0/7] Add support for unmounted dump target
assumed get_persistent_dev accepts any block target config format. But
it doesn't recognize the UUID= or LABEL= format. So always use the
wrapper version for kdump which supports it well.
Also fix a nfs detection issue introduced the that patch series.
Kairui Song (2):
Always wrap up call to dracut get_persistent_dev function
mkdumprd: Fix nfs detection in to_mount
dracut-module-setup.sh | 20 +++-----------------
kdump-lib.sh | 14 ++++++++++++++
kdumpctl | 2 +-
mkdumprd | 6 +++---
4 files changed, 21 insertions(+), 21 deletions(-)
--
2.26.2
3 years, 5 months
[PATCH] Fix kdump failure when mount target specified by dracut_args
by Kairui Song
commit 61e0169 changed definition of dump_fs function, so
need to do a mount target conversion before calling it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-kdump.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 9c8f3a9..b71278d 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -208,7 +208,10 @@ read_kdump_conf()
case "$config_opt" in
dracut_args)
config_val=$(get_dracut_args_target "$config_val")
- [ -n "$config_val" ] && add_dump_code "dump_fs $config_val"
+ if [ -n "$config_val" ]; then
+ config_val=$(get_mntpoint_from_target "$config_val")
+ add_dump_code "dump_fs $config_val"
+ fi
;;
ext[234]|xfs|btrfs|minix|nfs)
config_val=$(get_mntpoint_from_target "$config_val")
--
2.26.2
3 years, 5 months
[PATCH] mkdumprd: Fix dracut error on multiple extra_modules
by Kairui Song
Dracut expects --add-drivers with a single parameter, so mkdumprd
should quota the module list.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
mkdumprd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index 1bee98c..7bc1bd1 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -471,7 +471,7 @@ handle_default_dump_target
if [ -n "$extra_modules" ]
then
- add_dracut_arg "--add-drivers" "$extra_modules"
+ add_dracut_arg "--add-drivers" \"$extra_modules\"
fi
if ! is_fadump_capable; then
--
2.26.2
3 years, 5 months