diff --git a/SOURCES/kdump.conf b/SOURCES/kdump.conf index fc0aa6d..76fecd4 100644 --- a/SOURCES/kdump.conf +++ b/SOURCES/kdump.conf @@ -79,10 +79,9 @@ # or script after the vmcore dump process terminates. # The exit status of the current dump process is fed to # the executable binary or script as its first argument. -# 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. +# All files under /etc/kdump/post.d are collectively sorted +# and executed in lexical order, before binary or script +# specified kdump_post parameter is executed. # # kdump_pre # - Works like the "kdump_post" directive, but instead of running @@ -90,9 +89,8 @@ # Exit status of this binary is interpreted as follows: # 0 - continue with dump process as usual # 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 +# All files under /etc/kdump/pre.d 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. diff --git a/SOURCES/kdump.conf.5 b/SOURCES/kdump.conf.5 index 658d16e..4aacac8 100644 --- a/SOURCES/kdump.conf.5 +++ b/SOURCES/kdump.conf.5 @@ -109,10 +109,9 @@ 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. +All files under /etc/kdump/post.d 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. @@ -129,9 +128,8 @@ as follows: .PP 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 -lexical order, after binary or script specified +All files under /etc/kdump/pre.d 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. diff --git a/SOURCES/kdumpctl b/SOURCES/kdumpctl index 3a0f01a..b4dbef0 100755 --- a/SOURCES/kdumpctl +++ b/SOURCES/kdumpctl @@ -151,7 +151,7 @@ rebuild_initrd() check_exist() { for file in $1; do - if [ ! -f "$file" ]; then + if [ ! -e "$file" ]; then echo -n "Error: $file not found."; echo return 1 fi @@ -382,11 +382,11 @@ check_files_modified() done fi + # HOOKS is mandatory and need to check the modification time + files="$files $HOOKS" check_exist "$files" && check_executable "$EXTRA_BINS" [ $? -ne 0 ] && return 2 - # HOOKS only need to check the modification here - files="$files $HOOKS" for file in $files; do if [ -e "$file" ]; then time_stamp=`stat -c "%Y" $file` diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index 58a4a00..bd862ec 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.20 -Release: 31%{?dist} +Release: 32%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component @@ -379,6 +379,9 @@ done %endif %changelog +* Mon Aug 3 2020 Pingfan Liu - 2.0.20-32 +- kdumpctl: exit if either pre.d or post.d is missing + * Wed Jul 22 2020 Pingfan Liu - 2.0.20-31 - ppc64/kdump: use kexec_file_load when secureboot is enabled - kdump_pre: make notes more precise