In the UNIX tradition, there are two system startup schemes: the BSD scheme and the "System V" scheme, both named after the UNIX system which implemented them first (resp. Berkeley Software Distribution and AT&T UNIX System V). The BSD scheme is more simple, but the System V scheme, although less easy to understand (which will change once you finish this chapter), is definitely more flexible to use.
When the system starts, and after the kernel has configured everything and mounted the root filesystem, it executes /sbin/init [1]. init is the father of all processes of the system, and it is responsible for taking the system to the desired runlevel. We will look at runlevels in the next section.
The init configuration file is /etc/inittab. This file has its own manual page (inittab(5)), but here we will describe only a few of the configuration items.
The first line which should be the focus of your attention is this one:
si::sysinit:/etc/rc.d/rc.sysinit |
id:5:initdefault: |
l5:5:wait:/etc/rc.d/rc 5 |
init is also responsible for restarting (respawn) some programs, which it is the only process capable of restarting. This is the case, for example, for all login programs which run in each of the 6 virtual consoles[2]. For the second virtual console, this gives:
2:2345:respawn:/sbin/mingetty tty2 |
[1] | Now you see why putting /sbin on a filesystem other than the root filesystem is a very bad idea :-) |
[2] | So you can, if you want, add or remove virtual consoles by modifying this file, up to a maximum of 64, by following the syntax. But don't forget that X also runs on a virtual console! So leave it at least one free for it. |