If default action is poweroff, we can observe that the machine is rebooted,
instead of poweroff. That is due to the following two race processes:
systemctl reboot -f
which is launched by kdump-error-handle.sh.
Unfortunately, although both of them are executed in systemd block mode,
but due to poweroff will tear down some internal things in systemd, there
is no guarantee for the block mode. As we can see the msg "Failed to execute
operation: Connection reset by peer", which is thrown by "systemctl reboot
poweroff and reboot share most of code, if one fails, then the other should
also fails, so it is meaningless to use reboot as the backup of poweroff.
Using "systemctl poweroff -f", the sdbus will teared down immediately,
which prevent the following "systemctl reboot -f" from executing. Meanwhile,
as man systemctl says:
When used with enable, overwrite any existing conflicting symlinks.
When used with halt, poweroff, reboot or kexec, execute the selected operation
without shutting down all units. However, all processes will be killed
forcibly and all file systems are unmounted or remounted read-only.
Hence, replacing the 'poweroff' with 'systemctl poweroff -f'
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
kdump-lib-initramfs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index c7f874f..f5155a4 100755
@@ -63,7 +63,7 @@ get_kdump_confs()
+ DEFAULT_ACTION="systemctl poweroff -f"