From: Arusekk Date: Sun, 22 Mar 2020 09:41:18 +0000 (+0100) Subject: Fall back to kexec when no kexec binary exists X-Git-Tag: v246-rc1~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71180f8e57f8fbb55978b00a13990c79093ff7b3;p=thirdparty%2Fsystemd.git Fall back to kexec when no kexec binary exists This may be not a popular setup, but in case kexec resides somewhere different than the default location for KEXEC (`/usr/sbin/kexec`), don't just reboot and try doing `reboot(RB_KEXEC)` instead, just like what `kexec -e` normally does. --- diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index 15e6c1799e7..918cf20bd0a 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -547,6 +547,9 @@ int main(int argc, char *argv[]) { /* Child */ execv(args[0], (char * const *) args); + + /* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */ + (void) reboot(cmd); _exit(EXIT_FAILURE); }