[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: init: wait for sysinit completion
From: Anna Martynova <terrible.broom () gmail ! com>
Date: 2009-07-10 10:09:16
Message-ID: d9809a430907100309y260754d3x2b8d1433a4f88e9d () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thank you very much, it works with 'once' action.
You are my rescuer. :)
2009/7/9 Denys Vlasenko <vda.linux@googlemail.com>
> On Thu, Jul 9, 2009 at 12:26 PM, Anna Martynova<terrible.broom@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
>
[Attachment #5 (text/html)]
Thank you very much, it works with 'once' action.<br>You are my rescuer. \
:)<br><br><div class="gmail_quote">2009/7/9 Denys Vlasenko <span dir="ltr"><<a \
href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a>></span><br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On \
Thu, Jul 9, 2009 at 12:26 PM, Anna Martynova<<a \
href="mailto:terrible.broom@gmail.com">terrible.broom@gmail.com</a>> wrote:<br>
> Hello, all.<br>
> At the moment I am upgrading my system from busybox 1.8.2 to 1.14.2. I found<br>
> such difference in init behavior: in old version 'sysinit' action was \
called<br> > with run() function, so other init actions (such as \
'askfirst' - shells on<br> > virtual consoles) could be running at the \
same time. But in the latest<br> > version sysinit action is called with waitfor() \
function, and all other<br> > actions wait for it's completion.<br>
> I found this place in source and changed 'waitfor' to 'run' to \
check my<br> > guess. But the question still exists:<br>
> What for it has been made? For now I have no idea, from where I can call<br>
> other start scripts, except rcS... But I need virtual consoles. :)<br>
> Thanks in advance.<br>
<br>
</div></div>Looks like it was a bug. Sysinit action(s) should be waited for.<br>
This is what init.c says:<br>
<br>
/* Each type of actions can appear many times. They will be<br>
* handled in order. RESTART is an exception, only 1st is used.<br>
*/<br>
/* Start these actions first and wait for completion */<br>
#define SYSINIT 0x01<br>
/* Start these after SYSINIT and wait for completion */<br>
#define WAIT 0x02<br>
/* Start these after WAIT and *dont* wait for completion */<br>
#define ONCE 0x04<br>
/*<br>
* NB: while SYSINIT/WAIT/ONCE are being processed,<br>
* SIGHUP ("reread /etc/inittab") will be ignored.<br>
* Rationale: it would be ambiguous whether SYSINIT/WAIT/ONCE<br>
* need to be rerun or not.<br>
*/<br>
/* Start these after ONCE are started, restart on exit */<br>
#define RESPAWN 0x08<br>
/* Like RESPAWN, but wait for <Enter> to be pressed on tty */<br>
#define ASKFIRST 0x10<br>
/*<br>
* Start these on SIGINT, and wait for completion.<br>
* Then go back to respawning RESPAWN and ASKFIRST actions.<br>
* NB: kernel sends SIGINT to us if Ctrl-Alt-Del was pressed.<br>
*/<br>
#define CTRLALTDEL 0x20<br>
/*<br>
* Start these before killing all processes in preparation for<br>
* running RESTART actions or doing low-level halt/reboot/poweroff<br>
* (initiated by SIGUSR1/SIGTERM/SIGUSR2).<br>
* Wait for completion before proceeding.<br>
*/<br>
#define SHUTDOWN 0x40<br>
/*<br>
* exec() on SIGQUIT. SHUTDOWN actions are started and waited for,<br>
* then all processes are killed, then init exec's 1st RESTART action,<br>
* replacing itself by it. If no RESTART action specified,<br>
* SIGQUIT has no effect.<br>
*/<br>
#define RESTART 0x80<br>
<br>
<br>
Looks like you can use "once" to achieve what you want.<br>
<font color="#888888">--<br>
vda<br>
</font></blockquote></div><br>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic