From 354164c7e4be05d7072881b67c35b877783c3e04 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2019 12:54:12 +0000 Subject: import kexec-tools-2.0.15-21.el7_6.4 --- diff --git a/SOURCES/98-kexec.rules b/SOURCES/98-kexec.rules index e32ee13..36715d0 100644 --- a/SOURCES/98-kexec.rules +++ b/SOURCES/98-kexec.rules @@ -1,4 +1,16 @@ -SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl try-restart kdump.service" -SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl try-restart kdump.service" -SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl try-restart kdump.service" -SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl try-restart kdump.service" +SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload" +SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload" +SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload" +SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload" + +GOTO="kdump_reload_end" + +LABEL="kdump_reload" + +# If kdump is not loaded, calling "kdumpctl reload" will end up +# doing nothing, but it and systemd-run will always generate +# extra logs for each call, so trigger the "kdumpctl reload" +# only if kdump service is active to avoid unnecessary logs +RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet /usr/bin/kdumpctl reload'" + +LABEL="kdump_reload_end" diff --git a/SOURCES/kdump.service b/SOURCES/kdump.service index 5144597..f888dd6 100644 --- a/SOURCES/kdump.service +++ b/SOURCES/kdump.service @@ -7,6 +7,7 @@ DefaultDependencies=no Type=oneshot ExecStart=/usr/bin/kdumpctl start ExecStop=/usr/bin/kdumpctl stop +ExecReload=/usr/bin/kdumpctl reload RemainAfterExit=yes StartLimitInterval=0 diff --git a/SOURCES/kdumpctl b/SOURCES/kdumpctl index 0a65d10..d80bec8 100755 --- a/SOURCES/kdumpctl +++ b/SOURCES/kdumpctl @@ -382,6 +382,16 @@ check_boot_dir() setup_initrd() { + check_boot_dir + + if [ -z "$KDUMP_KERNELVER" ]; then + kdump_kver=`uname -r` + else + kdump_kver=$KDUMP_KERNELVER + fi + + kdump_kernel="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}" + DEFAULT_INITRD="${KDUMP_BOOTDIR}/initramfs-`uname -r`.img" DEFAULT_INITRD_BAK="${KDUMP_BOOTDIR}/.initramfs-`uname -r`.img.default" if [ $DEFAULT_DUMP_MODE == "fadump" ]; then @@ -628,15 +638,6 @@ check_rebuild() local _force_no_rebuild force_no_rebuild="0" local ret system_modified="0" - check_boot_dir - - if [ -z "$KDUMP_KERNELVER" ]; then - kdump_kver=`uname -r` - else - kdump_kver=$KDUMP_KERNELVER - fi - - kdump_kernel="${KDUMP_BOOTDIR}/${KDUMP_IMG}-${kdump_kver}${KDUMP_IMG_EXT}" setup_initrd if [ $? -ne 0 ]; then return 1 @@ -1212,6 +1213,42 @@ start() echo "Starting kdump: [OK]" } +reload() +{ + check_current_status + if [ $? -ne 0 ]; then + echo "Kdump is not running: [WARNING]" + return 0 + fi + + if [ $DEFAULT_DUMP_MODE == "fadump" ]; then + stop_fadump + else + stop_kdump + fi + + if [ $? -ne 0 ]; then + echo "Stopping kdump: [FAILED]" + return 1 + fi + + echo "Stopping kdump: [OK]" + + setup_initrd + if [ $? -ne 0 ]; then + echo "Starting kdump: [FAILED]" + return 1 + fi + + start_dump + if [ $? -ne 0 ]; then + echo "Starting kdump: [FAILED]" + return 1 + fi + + echo "Starting kdump: [OK]" +} + stop_fadump() { echo 0 > $FADUMP_REGISTER_SYS_NODE @@ -1295,6 +1332,9 @@ main () esac exit $EXIT_CODE ;; + reload) + reload + ;; restart) stop start @@ -1308,7 +1348,7 @@ main () show_reserved_mem ;; *) - echo $"Usage: $0 {start|stop|status|restart|propagate|showmem}" + echo $"Usage: $0 {start|stop|status|restart|reload|propagate|showmem}" exit 1 esac } diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index d434df8..e83756f 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.15 -Release: 21%{?dist}.3 +Release: 21%{?dist}.4 License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component. @@ -429,6 +429,9 @@ done %doc %changelog +* Mon Jun 10 2019 Bhupesh Sharma 2.0.15-21.4 +- [Hyper-V] Error applying Memory changes to larger size + * Fri Mar 22 2019 Bhupesh Sharma 2.0.15-21.3 - makedumpfile/arm64: Fix 'info->page_offset' calculation (use correct bug number)