Adopt BusyBox init signal handling for halt/reboot/poweroff

This patch adopts the BusyBox init signals for handling halt, reboot,
and poweroff.  The SIGINT and SIGPWR signals still behave the same as
before, even though they likely will become configurable in a future
release.

Note: the disabling of Ctrl-Alt-Delete (SIGINT) is also removed!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-07-29 16:47:38 +02:00
parent 0df0f019e3
commit eeb59eb22b
6 changed files with 144 additions and 41 deletions
+2 -2
View File
@@ -255,7 +255,7 @@ static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
switch (rq.runlevel) {
case '0':
_d("Halting system (SIGUSR2)");
do_shutdown(SIGUSR2);
do_shutdown(SHUT_OFF);
break;
case 's':
@@ -272,7 +272,7 @@ static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events))
case '6':
_d("Rebooting system (SIGUSR1)");
do_shutdown(SIGUSR1);
do_shutdown(SHUT_REBOOT);
break;
default: