From: James Griffiths (jamesg at domain linsol.com)
Date: Wed 08 Sep 1999 - 16:33:22 IST
> how do I get into single user mode when im booting up a
linux machine?
I looked at the init program a while back and discovered
some interesting and not-so-well-documented behaviour.
The following is based on SuSE and RedHat from a version
or so ago, but I believe it is still correct.
Internally init has a simple state-machine which it
uses to "remember" where it is at and what to do next.
When told to *boot* to single user mode, init does
the following :
1) run a "sysinit" entry from /etc/inittab if it exists
(the third field must read "sysinit")
2) run the entry(s) from /etc/inittab corresponding
to single (S) mode
Under SuSE, the /etc/inittab contains a line for the "S"
runlevel which runs /bin/sulogin and so a login is still
required. However, SuSE does not have any sysinit entry
and so the system is in a very restricted state e.g. root
is mounted read-only, no swap enabled etc.
Under RedHat, there is a sysinit entry which runs
/etc/rc.d/rc.sysinit. However the /etc/inittab does
*not* have any line for single user mode, so init
uses an internal default which runs a shell as root
(a copy of "bash" if I remember).
This is the behaviour under RedHat which allows the
familiar "login with no password" trick.
Looking at it from the viewpoint of a booted system
moving to single user mode, again SuSE and RedHat
are different.
Single user mode in SuSE is just that - to move to
it enter "telinit S" or equivalent. RedHat uses
the runlevel 1 which shuts down all the multiuser
stuff and as a last step does a "telinit S" to move
the init state machine to the "s" state.
Both systems allow booting to the "emergency" or
"-b" state where the root fs is mounted, but not
much more is done - e.g the sysinit entry from
/etc/inittab is *not* run.
Regards,
James Griffiths
Linux Solutions
http://www.linsol.com/
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:32 GMT