%general-entities; ]> Sysvinit-&sysvinit-version; Sysvinit The Sysvinit package contains programs for controlling the startup, running, and shutdown of your system. &buildtime; 0.1 SBU &diskspace; 0.9 MB Sysvinit installation depends on: Binutils, Coreutils, GCC, Glibc, Make. Installation of Sysvinit When run-levels are changed (for example, when halting the system), init sends termination signals to those processes that init itself started and that shouldn't be running in the new run-level. While doing this, init outputs messages like Sending processes the TERM signal which seem to imply that it is sending these signals to all currently running processes. To avoid this misinterpretation, you can modify the source so that these messages read like Sending processes started by init the TERM signal instead: cp src/init.c{,.backup} sed 's/Sending processes/& started by init/g' \ src/init.c.backup > src/init.c Compile Sysvinit: make -C src Then install it: make -C src install Configuring Sysvinit Sysvinit configuring /etc/inittab Create a new /etc/inittab file by running the following: cat > /etc/inittab << "EOF" # Begin /etc/inittab id:3:initdefault: si::sysinit:/etc/rc.d/init.d/rc sysinit 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 -I '\033(K' tty1 9600 2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600 3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600 4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600 6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600 # End /etc/inittab EOF The -I '\033(K' switch tells agetty to send this escape sequence to the terminal before doing anything else. This escape sequence switches the console character set to a user-defined one, which can be modified by running the setfont program. Actually, the console initscript from the LFS-Bootscripts package calls the setfont program during system startup. Sending this escape sequence is necessary for people who use non-ISO-8859-1 screen font, but does not hurt native English speakers. Contents of Sysvinit Installed programs: halt, init, killall5, last, lastb (link to last), mesg, pidof (link to killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit (link to init), utmpdump and wall Short descriptions halt halt normally invokes shutdown with the -h flag, except when already in run-level 0, then it tells the kernel to halt the system. But first it notes in the file /var/log/wtmp that the system is being brought down. init init is the mother of all processes. It reads its commands from /etc/inittab, which normally tell it which scripts to run for which run-level, and how many gettys to spawn. killall5 killall5 sends a signal to all processes, except the processes in its own session -- so it won't kill the shell running the script that called it. last last shows which users last logged in (and out), searching back through the file /var/log/wtmp. It can also show system boots and shutdowns, and run-level changes. lastb lastb shows the failed login attempts, as logged in /var/log/btmp. mesg mesg controls whether other users can send messages to the current user's terminal. pidof pidof reports the PIDs of the given programs. poweroff poweroff tells the kernel to halt the system and switch off the computer. But see halt. reboot reboot tells the kernel to reboot the system. But see halt. runlevel runlevel reports the previous and the current run-level, as noted in the last run-level record in /var/run/utmp. shutdown shutdown brings the system down in a secure way, signaling all processes and notifying all logged-in users. sulogin sulogin allows the superuser to log in. It is normally invoked by init when the system goes into single user mode. telinit telinit tells init which run-level to enter. utmpdump utmpdump displays the content of the given login file in a friendlier format. wall wall writes a message to all logged-in users.