diff options
author | Arusekk <arek_koz@o2.pl> | 2020-03-22 10:41:18 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-03-24 09:50:11 +0100 |
commit | 71180f8e57f8fbb55978b00a13990c79093ff7b3 (patch) | |
tree | cb58e87202a16f44752ffa8614bdc6247e9fa9d5 | |
parent | cdc6c95737d26b1746b446dfe662872d593d23c6 (diff) | |
download | systemd-71180f8e57f8fbb55978b00a13990c79093ff7b3.tar.gz |
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.
-rw-r--r-- | src/shutdown/shutdown.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index 15e6c1799e..918cf20bd0 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); } |