aboutsummaryrefslogtreecommitdiff
path: root/src/rc/openrc-shutdown.c
diff options
context:
space:
mode:
authorWilliam Hubbs <william.hubbs@sony.com>2019-07-22 18:29:27 -0500
committerWilliam Hubbs <william.hubbs@sony.com>2019-07-25 14:47:18 -0500
commitcac41092e4180a8d16edacab0c8552585d94328b (patch)
tree1cfd4a49fdce5097e2bcf83acc8115002aad74c2 /src/rc/openrc-shutdown.c
parent7ddc281ab6fd11b63f41059818b0de4748e2821f (diff)
add ability for openrc-shutdown to communicate with sysvinit
This fixes #315.
Diffstat (limited to 'src/rc/openrc-shutdown.c')
-rw-r--r--src/rc/openrc-shutdown.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rc/openrc-shutdown.c b/src/rc/openrc-shutdown.c
index 82dde517..4dcd7e16 100644
--- a/src/rc/openrc-shutdown.c
+++ b/src/rc/openrc-shutdown.c
@@ -35,8 +35,9 @@
#include "rc.h"
#include "helpers.h"
#include "rc-misc.h"
-#include "_usage.h"
+#include "rc-sysvinit.h"
#include "rc-wtmp.h"
+#include "_usage.h"
const char *applet = NULL;
const char *extraopts = NULL;
@@ -328,15 +329,17 @@ int main(int argc, char **argv)
syslog(LOG_NOTICE, "The system will %s now", state);
unlink(nologin_file);
unlink(shutdown_pid);
- if (do_halt)
+ if (do_halt) {
+ sysvinit_runlevel('0');
send_cmd("halt");
- else if (do_kexec)
+ } else if (do_kexec)
send_cmd("kexec");
else if (do_poweroff)
send_cmd("poweroff");
- else if (do_reboot)
- send_cmd("reboot");
- else if (do_single)
+ else if (do_reboot) {
+ sysvinit_runlevel('6');
+ send_cmd("reboot");
+ } else if (do_single)
send_cmd("single");
return 0;
}