[PATCH] Add halt handler for SIGPWR

Denys Vlasenko vda.linux at googlemail.com
Tue Nov 26 13:15:56 UTC 2013


Applied, thanks!

On Tue, Nov 26, 2013 at 10:17 AM, Bogdan Purcareata
<bogdan.purcareata at freescale.com> wrote:
> 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
>
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list