Single User Mode

Richard Gollub rgollub at uninet.com.br
Fri Mar 9 07:31:46 PST 2001


David Turner wrote:
> 
> Gerard Beekmans wrote:
> >
> > There probably are other lines in inittab that tell init to start bash or
> > sulogin or something like that when switching to runlevel 1.
> 
> I thought so too, but this is why I'm puzzled:
> 
> [dcturner at dct25 14:25:24 /etc] $ grep inittab -e
> "^[^:]*:\([0-6sS]*1[0-6sS]*\)\?:"
> si::sysinit:/etc/rc.d/rc.sysinit
> l1:1:wait:/etc/rc.d/rc 1
> ud::once:/sbin/update
> ca::ctrlaltdel:/sbin/shutdown -t3 -h now
> pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting
> Down"
> pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown
> Cancelled"
> 
> However, I read the init man page a bit more closely and found a small
> paragraph which reads
> 
> > Runlevel  S  or s bring the system to single user mode and
> > do not require an  /etc/initttab  file.   In  single  user
> > mode, a root shell is opened on /dev/console.
> 
> This leads me to believe that it's just me being useless at setting my
> boot disk up.  I will try again, and thanks for your help.

	The key here is inittab line 'l1:1:wait:/etc/rc.d/rc 1' which executes
the linked scripts in rc1.d.

	As an illustration herewith attached my regular set-up in LFS:

[root at lfs0 /etc]# cat inittab
# Begin /etc/inittab

id:5:initdefault:

si::sysinit:/etc/init.d/rcS

su:S:wait:/sbin/sulogin

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6

fb:06:respawn:/sbin/sulogin

ca:12345:ctrlaltdel:/sbin/shutdown -t 1 -r now

 1:2345:respawn:/sbin/agetty tty1 9600
 2:2345:respawn:/sbin/agetty tty2 9600
 3:2345:respawn:/sbin/agetty tty3 9600
 4:2345:respawn:/sbin/agetty tty4 9600
 5:2345:respawn:/sbin/agetty tty5 9600
 6:2345:respawn:/sbin/agetty tty6 9600

 x:5:respawn:/etc/X11/DM -nodaemon > /var/log/DM.log 2>&1

[root at lfs0 /etc]# ls rc1.d
total 4
lrwxrwxrwx   1 root root      18 Jul 10  2000 K20sendmail ->
../init.d/sendmail*
lrwxrwxrwx   1 root root      17 Jul 10  2000 K30proftpd ->
../init.d/proftpd*
lrwxrwxrwx   1 root root      15 Jul 10  2000 K40inetd ->
../init.d/inetd*
lrwxrwxrwx   1 root root      15 Jul 28  2000 K60lprng ->
../init.d/lprng*
lrwxrwxrwx   1 root root      16 Sep 16 18:47 K70oracle ->
../init.d/oracle*
lrwxrwxrwx   1 root root      18 Jul 10  2000 K90sysklogd ->
../init.d/sysklogd*
lrwxrwxrwx   1 root root      16 Jul 10  2000 S00single ->
../init.d/single*

[root at lfs0 /etc]# cat init.d/single
#! /bin/sh

exec init S

	Cheers,
	Richard

-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list