[Pkg-sysvinit-devel] init do not pass correct PREVLEVEL when switching from runlevel S

Petter Reinholdtsen pere at hungry.com
Wed Sep 13 11:49:03 UTC 2006


I just discovered a problem with the debian boot system.
/etc/init.d/rc assume environment variables RUNLEVEL and PREVLEVEL is
correctly set when switching from one runlevel to another.  This is
not true when switching from runlevel S (the bootup "runlevel") to
runlevel 2.  The result is that start scripts started with the symlink
in rcS.d/ will also run with the symlink in rc2.d/.

I'm not quite sure why, but suspect the reason is that init expect
runlevel 'S' to be single-user, and not the bootup runlevel.

Any idea how to avoid this problem?  Renaming rcS.d/ to something eles
would be the obvious fix, but I am not sure if that is easy to do.
Rewriting init to not use the 'S' string to indicate the singleuser
runlevel might be another, but I am not quite sure if that is a good
idea either.

The more I study the boot system in debian, the more design problems I
find.  For example, why are there start symlinks in rc0.d and rc6.d
used as stop symlinks, instead of renaming S* to K* and place them
where they should be in the stop sequence?  And now this, the S
runlevel being both single user (according to init) and bootup
according to inittab.  :/

Friendly,
-- 
Petter Reinholdtsen
c



More information about the Pkg-sysvinit-devel mailing list