[BusyBox] how to get "reboot" to work when using "minit"??

Rob Landley rob at landley.net
Sun May 9 08:37:54 UTC 2004


On Thursday 06 May 2004 12:54, Robert P. J. Day wrote:
> On Thu, 6 May 2004, Rob Landley wrote:
> > By definition, init should be pid 1.  If it isn't, the system is Not
> > Happy (tm) in many ways.  (I've done this, years ago.  It was interesting
> > to debug. My init script was calling init as a normal program, when it
> > was supposed to exec it...)
>
> if i boot with "init=/sbin/minit", then the resulting minit executable
> *does* have PID 1.  anyway, i didn't mean to drag this thread out this
> long.
>
> the issue is, i've built a system that has both the BB "init" applet (and
> supporting files), as well as an external "minit" executable (and
> supporting /etc/minit directory structure).
>
> at the moment, i can boot and choose which init program i want to use
> at the boot line.  that's not the problem.  the problem is that, if
> i boot with minit, then the BB "reboot" applet can't reboot since it
> apparently won't recognize minit as PID 1.
>
> so the question is, is this a flaw in the BB reboot applet?  should it
> be general enough to handle this situation?  my opinion is that it
> should be.  but that's just my opinion.

Init is always pid 1.  By definition.  If pid 1 exits, the kernel panics with 
"attempted to kill init".  PID 1 will inherit orphan child processes.  Check 
the implementation of the kernel function "daemonize()", which used to be 
called reparent_to_init().

If init is ever NOT running as PID 1, this is a bug.

> rday

Rob




More information about the busybox mailing list