Linux System Process Initialization (SysV)

Traditionally, Linux systems (and Unix systems before them) have used a sequential startup mechanism, which is described here. There is another page that describes a newer mechanism, known as Upstart and yet another page that describes an even newer mechanism known as systemd.

This older method of system initialization is still in wide use. Moreover, for compatibility reasons, much of its functionality is incorporated into upstart and systemd.

The method described on this page originated in a Unix version from AT&T Bell Labs, called "System V" where the "V" is Roman-numeral 5. "System V" is often abbreviated "SysV" and so that is what we use to distinguish this mechanism from the upstart and systemd mechanisms.

After the Linux kernel initialization is completed, the init script executes the program /sbin/init.

/sbin/init reads the file /etc/inittab which determines a series of scripts to be run to complete the initialization process:

  1. The first script that init runs is /etc/rc.d/rc.sysinit. This script does several initialization tasks.
  2. The next thing init does (again driven by entries in /etc/inittab) is run /etc/rc.d/rc, passing it a number known as the runlevel. Certain runlevels are standard:

    0 = halt
    1 = single-user mode
    6 = reboot

    Runlevels 2-5 are used for various forms of multi-user mode; the exact meaning of these runlevels differs among distros.

    The initial runlevel is specified in /etc/inittab.

    (The processing in this step can also be rerun by the system administrator after the boot process is finished in order to change the run level from the previously set level to a new run level. The administrator does this by running the command /sbin/init X (where X is the runlevel as above). Note that this program (/sbin/init) is the same program that runs during system initialization. If /sbin/init is run as process ID 1 then it does all of the processing described on this page. If run as any other process ID it simply sends a signal with the new runlevel to process ID 1 (the "real" init process) which runs the RC scripts as described in this step. In the case of the system administrator resetting the runlevel, the first step is to run the scripts in the directory /rc.d/rcX.d (where X is the old runlevel) whose name begin with "K". Each of these scripts is passed the parameter, "stop". These are actually symbolic links to files in /etc/rc.d/init.d.) This stops the programs that were running at the previous run level.

    Next the scripts in the directory /rc.d/rcX.d (where X is the new runlevel) whose name begin with "S" are run. Each of these scripts is passed the parameter, "start". These "S" files are also symbolic links to files in /etc/rc.d/init.d. This starts the programs that are to run at the new run level.

    Note: It would be wasteful or even harmful to stop and then restart a program that is needed on both the old and new runlevels. For that reason, this condition is detected and the stop and start steps are skipped programs that are on both runlevels.

Once the RC scripts are run, the init process then reads additional entries in /etc/inittab and uses them to start various local login mechanisms.

Next: Login

Return to main PC Boot Sequence page

Return to my writing page

Return to my home page