]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: if kexec fails with --force, continue to reboot normally
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Mar 2018 10:27:15 +0000 (11:27 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Mar 2018 09:43:54 +0000 (10:43 +0100)
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.

src/systemctl/systemctl.c

index dfc9630f55de08bd36b067352c56e50fdd634892..393c35c60fe177252ff08a6c091431f00945f774 100644 (file)
@@ -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) {