Linux System Process Initialization Using Upstart

Traditionally, Linux systems (and Unix systems before them) have used a sequential startup mechanism, which is described here. This page describes a newer mechanism, known as "Upstart". See this page for the descritpion of systemd.

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

The upstart version of init reads a series of files from the directory /etc/init or its children. Each of these files describes a "service," typically a daemon that runs in the background to perform some system function. Here is an example.

Although some .conf files are more complicated than this example, many are this simple. They typically specify "triggers" that will cause the service to be started or stopped, and what to run to start the service.

The init process monitors a service while it is running and can restart it if it fails.

Another startup file looks like this. This file runs the rc script. This has the effect of running any traditional startup scripts as supported by the "SysV" or legacy init process.

The other concept carried over from the traditional startup mechanism is the idea of runlevels. There are handled by this config file. This script picks the default run level using these rules:

  1. If a number appears on the kernel command line (passed from the boot loader to the kernel) then that number becomes the initial runlevel.
  2. If "S", "-s", or "single" appears on the kernel command line, the initial runlevel is "S" (single user mode without startup).
  3. If the runlevel is not on the kernel command line, then the default runlevel is taken from /etc/inittab if it exists.
  4. If none of the above is true, then a default runlevel (2) is selected.
The last thing that this config file does is actually set the runlevel determined from the above steps. The setting of the runlevel is the trigger for the running of rc.conf previously mentioned.

Other files start terminal connections, and start the GUI environment. This has the effect of starting various local login mechanisms.

The real advantage of upstart over the SysV init process is that the latter mechanism runs strictly sequentially, upstart is designed to run initialization steps in parallel, as defined by the .conf files. This generates a tree of startup tasks. For example here is the tree for Fedora 14.

Next: Login

Return to main PC Boot Sequence page

Return to my writing page

Return to my home page