[PATCH] init: Add handshake to poweroff/reboot for signal handler setup

Michael Conrad mconrad at intellitree.com
Wed Feb 14 19:21:58 UTC 2018


On 11/24/2017 9:09 PM, Deb McLemore wrote:
> +				while (1) {
> +					fdrc = connect(fdBB2,
> +					(struct sockaddr *)&bb_addr2,
> +					sizeof(sa_family_t) +
> +						BB_SIGNALS_SOCKET_STR_LEN);
> +					if (fdrc == 0)
> +						break;
> +					sleep(1);
> +				}

On 2/14/2018 1:58 PM, Michael Conrad wrote:
> This will give you even better "instant boot sequence abort" 
> performance than you would get with the design you're proposing, 
> unless you have some insanely high polling rate in the reboot_helper 
> that you think can actually deliver the signal before init has even 
> forked for the first time. 

Sorry, I wasn't paying close enough attention to what you were 
proposing.  If you have a 1-second sleep, then you're really not trying 
to block the startup sequence, you're just looking for a way to make 
sure the signal gets delivered?

...then just

/bin/reboot:

    #! /bin/sh
    while ! -d /proc; do sleep 1; done;
    /bin/busybox reboot




More information about the busybox mailing list