[PATCH] Add halt handler for SIGPWR
Bogdan Purcareata
bogdan.purcareata at freescale.com
Tue Nov 26 09:17:23 UTC 2013
Most init processes implement a handler for SIGPWR that gracefully
stops all child processes when shutting down a machine. Some other
technologies rely on this signal - e.g. Busybox powered LXC
containers.
This patch makes busybox init halt when receiving SIGPWR.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata at freescale.com>
---
init/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/init/init.c b/init/init.c
index c63bba1..ab1c5c2 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1135,6 +1135,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
struct sigaction sa;
bb_signals(0
+ + (1 << SIGPWR) /* halt */
+ (1 << SIGUSR1) /* halt */
+ (1 << SIGTERM) /* reboot */
+ (1 << SIGUSR2) /* poweroff */
--
1.7.10.4
More information about the busybox
mailing list