From: Zbigniew Jędrzejewski-Szmek Date: Thu, 8 Mar 2018 10:27:15 +0000 (+0100) Subject: systemctl: if kexec fails with --force, continue to reboot normally X-Git-Tag: v239~532^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d23b5ce2b6026eaa532feb9b669f217aee2782ea;p=thirdparty%2Fsystemd.git systemctl: if kexec fails with --force, continue to reboot normally When we are in late shutdown, and for whatever reason kexec fails, we should proceed with a normal reboot. Network is down and sessions have been terminated when we attempt to do the kexec, so rebooting normally is a better solution. Logs from the case where the kexec kernel is not usable: Mar 08 11:23:10 fuefi systemd[1]: Reached target Final Step. Mar 08 11:23:10 fuefi systemd[1]: Starting Reboot via kexec... Mar 08 11:23:10 fuefi systemctl[1480]: Cannot find the ESP partition mount point. Mar 08 11:23:10 fuefi systemctl[1480]: Failed to load kexec kernel, continuing without. Mar 08 11:23:10 fuefi systemd[1]: Shutting down. ... and then we proceed to do a normal reboot Related to #7730. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index dfc9630f55d..393c35c60fe 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3603,7 +3603,9 @@ static int start_special(int argc, char *argv[], void *userdata) { } else if (a == ACTION_KEXEC) { r = load_kexec_kernel(); - if (r < 0) + if (r < 0 && arg_force >= 1) + log_notice("Failed to load kexec kernel, continuing without."); + else if (r < 0) return r; } else if (a == ACTION_EXIT && argc > 1) {