init: wait for sysinit completion

Anna Martynova terrible.broom at gmail.com
Fri Jul 10 10:09:16 UTC 2009


Thank you very much, it works with 'once' action.
You are my rescuer. :)

2009/7/9 Denys Vlasenko <vda.linux at googlemail.com>

> On Thu, Jul 9, 2009 at 12:26 PM, Anna Martynova<terrible.broom at gmail.com>
> wrote:
> > Hello, all.
> > At the moment I am upgrading my system from busybox 1.8.2 to 1.14.2. I
> found
> > such difference in init behavior: in old version 'sysinit' action was
> called
> > with run() function, so other init actions (such as 'askfirst' - shells
> on
> > virtual consoles) could be running at the same time. But in the latest
> > version sysinit action is called with waitfor() function, and all other
> > actions wait for it's completion.
> > I found this place in source and changed 'waitfor' to 'run' to check my
> > guess. But the question still exists:
> > What for it has been made? For now I have no idea, from where I can call
> > other start scripts, except rcS... But I need virtual consoles. :)
> > Thanks in advance.
>
> Looks like it was a bug. Sysinit action(s) should be waited for.
> This is what init.c says:
>
> /* Each type of actions can appear many times. They will be
>  * handled in order. RESTART is an exception, only 1st is used.
>  */
> /* Start these actions first and wait for completion */
> #define SYSINIT     0x01
> /* Start these after SYSINIT and wait for completion */
> #define WAIT        0x02
> /* Start these after WAIT and *dont* wait for completion */
> #define ONCE        0x04
> /*
>  * NB: while SYSINIT/WAIT/ONCE are being processed,
>  * SIGHUP ("reread /etc/inittab") will be ignored.
>  * Rationale: it would be ambiguous whether SYSINIT/WAIT/ONCE
>  * need to be rerun or not.
>  */
> /* Start these after ONCE are started, restart on exit */
> #define RESPAWN     0x08
> /* Like RESPAWN, but wait for <Enter> to be pressed on tty */
> #define ASKFIRST    0x10
> /*
>  * Start these on SIGINT, and wait for completion.
>  * Then go back to respawning RESPAWN and ASKFIRST actions.
>  * NB: kernel sends SIGINT to us if Ctrl-Alt-Del was pressed.
>  */
> #define CTRLALTDEL  0x20
> /*
>  * Start these before killing all processes in preparation for
>  * running RESTART actions or doing low-level halt/reboot/poweroff
>  * (initiated by SIGUSR1/SIGTERM/SIGUSR2).
>  * Wait for completion before proceeding.
>  */
> #define SHUTDOWN    0x40
> /*
>  * exec() on SIGQUIT. SHUTDOWN actions are started and waited for,
>  * then all processes are killed, then init exec's 1st RESTART action,
>  * replacing itself by it. If no RESTART action specified,
>  * SIGQUIT has no effect.
>  */
> #define RESTART     0x80
>
>
> Looks like you can use "once" to achieve what you want.
> --
> vda
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090710/2c07dafe/attachment.htm>


More information about the busybox mailing list