diff -Nru makedumpfile-1.6.5/debian/50-kdump-tools.rules makedumpfile-1.6.5/debian/50-kdump-tools.rules --- makedumpfile-1.6.5/debian/50-kdump-tools.rules 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/50-kdump-tools.rules 2019-07-20 13:02:04.000000000 -0300 @@ -1,4 +1,5 @@ -SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl try-restart kdump-tools.service" -SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="add", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="remove", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" +SUBSYSTEM=="cpu", ACTION=="online", PROGRAM="/bin/systemctl reset-failed kdump-tools.service ; /bin/systemctl try-restart kdump-tools.service" diff -Nru makedumpfile-1.6.5/debian/changelog makedumpfile-1.6.5/debian/changelog --- makedumpfile-1.6.5/debian/changelog 2019-02-07 09:22:23.000000000 -0200 +++ makedumpfile-1.6.5/debian/changelog 2019-07-20 16:14:52.000000000 -0300 @@ -1,3 +1,15 @@ +makedumpfile (1:1.6.5-1ubuntu1~18.04.2) bionic; urgency=medium + + [ Guilherme G. Piccoli ] + * Add kdump retry/delay mechanism when dumping over network (LP: #1681909) + + [ Thadeu Lima de Souza Cascardo ] + * Use maxcpus instead of nr_cpus on ppc64el. (LP: #1828597) + * Reload kdump when CPU is brought online. (LP: #1828596) + * Allow proper reload of kdump after multiple hotplug events. (LP: #1828596) + + -- Thadeu Lima de Souza Cascardo Sat, 20 Jul 2019 16:14:52 -0300 + makedumpfile (1:1.6.5-1ubuntu1~18.04.1) bionic; urgency=low * Backport back to bionic. (LP: #1655280) (LP: #1790788) diff -Nru makedumpfile-1.6.5/debian/kdump-config.in makedumpfile-1.6.5/debian/kdump-config.in --- makedumpfile-1.6.5/debian/kdump-config.in 2019-01-05 09:01:02.000000000 -0200 +++ makedumpfile-1.6.5/debian/kdump-config.in 2019-07-20 13:01:39.000000000 -0300 @@ -50,6 +50,8 @@ KDUMP_NUM_DUMPS=${KDUMP_NUM_DUMPS:=0} NFS_TIMEO=${NFS_TIMEO:=600} NFS_RETRANS=${NFS_RETRANS:=3} +NFS_MOUNT_RETRY=${NFS_MOUNT_RETRY:=4} +SSH_KDUMP_RETRY=${SSH_KDUMP_RETRY:=16} MAKEDUMP_ARGS=${MAKEDUMP_ARGS:="-c -d 31"} KDUMP_CMDLINE_APPEND=${KDUMP_CMDLINE_APPEND:="@KDUMP_CMDLINE_APPEND@"} KDUMP_KERNEL_HOOK="/etc/kernel/postinst.d/kdump-tools" @@ -647,8 +649,21 @@ # if [ -n "$NFS" ];then log_action_msg "Mounting NFS mountpoint $NFS ..." - mount -t nfs -o nolock -o tcp -o soft -o timeo=${NFS_TIMEO} -o retrans=${NFS_RETRANS} $NFS $KDUMP_COREDIR - ERROR=$? + MOUNTOPTS="-o nolock -o tcp -o soft -o timeo=${NFS_TIMEO} -o retrans=${NFS_RETRANS}" + + CNT=${NFS_MOUNT_RETRY} + while [ $CNT -ne 0 ];do + mount -t nfs $MOUNTOPTS $NFS $KDUMP_COREDIR + ERROR=$? + if [ $ERROR -eq 0 ];then + CNT=0 + else + ((CNT--)) + log_action_msg "Network not reachable; will try $CNT more times" + sleep 3 + fi + done + if [ $ERROR -ne 0 ];then log_failure_msg "$NAME: Unable to mount remote NFS directory $NFS. Cannot save core" logger -t $NAME "Unable to mount remote NFS directory $NFS. Cannot save core" @@ -759,14 +774,23 @@ KDUMP_COREFILE="$KDUMP_STAMPDIR/dump.$KDUMP_STAMP" KDUMP_TMPDMESG="/tmp/dmesg.$KDUMP_STAMP" KDUMP_DMESGFILE="$KDUMP_STAMPDIR/dmesg.$KDUMP_STAMP" - ERROR=0 - ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST mkdir -p $KDUMP_STAMPDIR - ERROR=$? - # If remote connections fails, no need to continue - if [ $ERROR -ne 0 ] ; then - log_failure_msg "$NAME: Unable to reach remote server $KDUMP_REMOTE_HOST. No reason to continue" - logger -t $NAME "Unable to reach remote server $KDUMP_REMOTE_HOST. No reason to continue" + CNT=${SSH_KDUMP_RETRY} + while [ $CNT -ne 0 ];do + ssh -i $KDUMP_SSH_KEY $KDUMP_REMOTE_HOST mkdir -p $KDUMP_STAMPDIR + ERROR=$? + if [ $ERROR -eq 0 ];then + CNT=0 + else + ((CNT--)) + log_action_msg "Network not reachable; will try $CNT more times" + sleep 3 + fi + done + + if [ $ERROR -ne 0 ]; then + log_failure_msg "$NAME: Unable to reach remote server $KDUMP_REMOTE_HOST; can't continue" + logger -t $NAME "Unable to reach remote server $KDUMP_REMOTE_HOST; can't continue" return 1 fi diff -Nru makedumpfile-1.6.5/debian/rules makedumpfile-1.6.5/debian/rules --- makedumpfile-1.6.5/debian/rules 2019-01-14 15:42:44.000000000 -0200 +++ makedumpfile-1.6.5/debian/rules 2019-07-20 11:25:01.000000000 -0300 @@ -7,13 +7,13 @@ SUBSTVARS = -Vdist:Depends="kexec-tools" endif -KDUMP_CMDLINE_APPEND = nr_cpus=1 systemd.unit=kdump-tools-dump.service +KDUMP_CMDLINE_APPEND = systemd.unit=kdump-tools-dump.service ifeq ($(DEB_HOST_ARCH),arm64) - # pass + KDUMP_CMDLINE_APPEND += nr_cpus=1 else ifeq ($(DEB_HOST_ARCH),ppc64el) - KDUMP_CMDLINE_APPEND += irqpoll noirqdistrib nousb + KDUMP_CMDLINE_APPEND += maxcpus=1 irqpoll noirqdistrib nousb else - KDUMP_CMDLINE_APPEND += irqpoll nousb ata_piix.prefer_ms_hyperv=0 + KDUMP_CMDLINE_APPEND += nr_cpus=1 irqpoll nousb ata_piix.prefer_ms_hyperv=0 endif %: