Skip to content

Commit 71180f8

Browse files
Arusekkkeszybz
authored andcommitted
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.
1 parent cdc6c95 commit 71180f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shutdown/shutdown.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,9 @@ int main(int argc, char *argv[]) {
547547
/* Child */
548548

549549
execv(args[0], (char * const *) args);
550+
551+
/* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */
552+
(void) reboot(cmd);
550553
_exit(EXIT_FAILURE);
551554
}
552555

0 commit comments

Comments
 (0)