Skip to content

Commit

Permalink
Fall back to kexec when no kexec binary exists
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Arusekk authored and keszybz committed Mar 24, 2020
1 parent cdc6c95 commit 71180f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shutdown/shutdown.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 71180f8

Please sign in to comment.