Free Hosting Online for WorkStations

< Previous | Contents | Next >

7.6.2. Configuring Sysvinit‌

During the kernel initialization, the first program that is run is either specified on the command line or, by default init. This program reads the initialization file /etc/inittab. Create this file with:


cat > /etc/inittab << "EOF"

# Begin /etc/inittab id:3:initdefault: si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0

l1:S1:wait:/etc/rc.d/init.d/rc 1

l2:2:wait:/etc/rc.d/init.d/rc 2

l3:3:wait:/etc/rc.d/init.d/rc 3

l4:4:wait:/etc/rc.d/init.d/rc 4

l5:5:wait:/etc/rc.d/init.d/rc 5

l6:6:wait:/etc/rc.d/init.d/rc 6 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

cat > /etc/inittab << "EOF"

# Begin /etc/inittab id:3:initdefault: si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0

l1:S1:wait:/etc/rc.d/init.d/rc 1

l2:2:wait:/etc/rc.d/init.d/rc 2

l3:3:wait:/etc/rc.d/init.d/rc 3

l4:4:wait:/etc/rc.d/init.d/rc 4

l5:5:wait:/etc/rc.d/init.d/rc 5

l6:6:wait:/etc/rc.d/init.d/rc 6 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin


1:2345:respawn:/sbin/agetty 2:2345:respawn:/sbin/agetty 3:2345:respawn:/sbin/agetty 4:2345:respawn:/sbin/agetty 5:2345:respawn:/sbin/agetty

6:2345:respawn:/sbin/agetty

1:2345:respawn:/sbin/agetty 2:2345:respawn:/sbin/agetty 3:2345:respawn:/sbin/agetty 4:2345:respawn:/sbin/agetty 5:2345:respawn:/sbin/agetty

6:2345:respawn:/sbin/agetty


# End /etc/inittab

EOF

# End /etc/inittab

EOF


--noclear tty1 9600

--noclear tty1 9600

tty2 tty3 tty4 tty5

tty6

tty2 tty3 tty4 tty5

tty6

9600

9600

9600

9600

9600

9600

9600

9600

9600

9600

An explanation of this initialization file is in the man page for inittab. For LFS, the key command that is run is rc. The initialization file above will instruct rc to run all the scripts starting with an S in the /etc/rc.d/rcS.d directory followed by all the scripts starting with an S in the /etc/rc.d/rc?.d directory where the question mark is specified by the initdefault value.

As a convenience, the rc script reads a library of functions in /lib/lsb/init-functions. This library also reads an optional configuration file, /etc/sysconfig/rc.site. Any of the system configuration file parameters described in subsequent sections can be alternatively placed in this file allowing consolidation of all system parameters in this one file.

As a debugging convenience, the functions script also logs all output to /run/var/bootlog. Since the /run directory is a tmpfs, this file is not persistent across boots, however it is appended to the more permanent file /var/ log/boot.log at the end of the boot process.


 

Top OS Cloud Computing at OnWorks: