[PATCH] init: Set the RUNLEVEL environment

Shaun Jackman sjackman at gmail.com
Sat Jul 8 19:17:57 UTC 2006


On 7/8/06, Rob Landley <rob at landley.net> wrote:
> On Friday 07 July 2006 8:48 pm, Shaun Jackman wrote:
> > Busybox's init application does not use the runlevel argument, except
> > for the special case of single-user mode. This patch passes the
> > runlevel argument on to the children processes in the environment
> > variable RUNLEVEL so that they may do something with it. For example,
> > I have an /etc/rc file that simply calls /etc/rc$RUNLEVEL. This
> > behaviour matches that of the standard Linux System-V-like init
> > application. Please apply.
>
> Busybox init doesn't support runlevels.  Busybox init has never supported
> runlevels.  Our inittab doesn't do runlevels.

Exactly. Since init doesn't handle runlevels, this two-line patch
allows /etc/rc (or kin) to handle runlevels by passing the environment
variable on to the child process. If we're not going to do this work
in init -- which is a fine design choice, since it simplifies init
greatly -- we should at least give the next level the opportunity to
handle the runlevel.

For example...
$ cat /etc/rc
exec /etc/rc$RUNLEVEL

Cheers,
Shaun



More information about the busybox mailing list