This patch checks the update of the binary and script files in /etc/kdump/{pre.d,post.d} for initramfs of kdump. When kdumpd service is started or restarted, initramfs of kdump is recreated by new the binary and script files, if the binary and script files in /etc/kdump/{pre.d,post.d} are updated.
Signed-off-by: shin-onitsuka onitsuka.shinic@fujitsu.com
--- kdumpctl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index f75b820..136fd36 100755 --- a/kdumpctl +++ b/kdumpctl @@ -335,9 +335,19 @@ check_files_modified()
EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2` CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2` + if [ -d /etc/kdump/post.d ]; then + for file in `find /etc/kdump/post.d -type f`; do + POST_FILES="$POST_FILES $file" + done + fi + if [ -d /etc/kdump/pre.d ]; then + for file in `find /etc/kdump/pre.d -type f`; do + PRE_FILES="$PRE_FILES $file" + done + fi CORE_COLLECTOR=`grep ^core_collector $KDUMP_CONFIG_FILE | cut -d\ -f2` CORE_COLLECTOR=`type -P $CORE_COLLECTOR` - EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES $POST_FILES $PRE_FILES" CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-` EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS $CORE_COLLECTOR" -- 1.8.3.1