[Pkg-sysvinit-devel] Bug#438529: sysvinit: /sbin/runlevel output confused in single-user
pere at hungry.com
Sun Jan 13 08:55:42 UTC 2008
[Martin J. Carter]
> I've now RTFM on init(8) under etch: not only is /bin/runlevel
> performing as advertised, but I've also been stepping into the
> blockhole mentioned in the new paragraph in the WARNINGS section.
> The only way round all this I can see would be to special-case S ->
> 2 as (S then 1) -> 2 in /etc/init.d/rc, but that way madness lies.
Yes, it behaves as documented and it is seriously messed up.
Historical reasons is the source of all this. The real problem is
that rcS.d/ is not really the S runlevel, as the S runlevel is
supposed to be single-user. The stuff in rcS.d is called rc.boot in
SUSE and is a single file /etc/rc.d/rc.sysinit in Fedora and Redhat.
And runlevel 1 is not really the single user runlevel either. It is a
runlevel used to pass into the single user runlevel. So there is a
distinct difference between booting using 'linux S' or 'linux single'
as the kernel paramenter, and using 'linux 1'. Only the latter work
as single user is intended to work. The others only run the boot
scripts in the boot runlevel (which is the scrints in rcS.d/, before
it switches to runlevel S which only runs /sbin/sulogin .
One solution would be to rename rcS.d/ to rc.boot or something not
matching the runlevel string used by single user (S), to make sure the
init.d/rc script is able to properly calculate what scripts were
executed in the previous runlevel. This would add more confusion, as
it then would run the scripts present in both rcS.d and (for example)
rc2.d twice. It would also require quite a lot of coordination. :/
So I am not sure if this is solvable, and suggest you boot using
'linux 1' instead of 'linux s' to boot in single user.
More information about the Pkg-sysvinit-devel