utility that selects which SysV-style init scripts will be run in each runlevel When compared to its predecessors, AT&T's
UNIX System III introduced a new style of system startup configuration, which survived (with modifications) into
UNIX System V and is therefore called the "SysV-style init". At any moment, a running System V is in one of the predetermined number of states, called
runlevels. At least one runlevel is the normal operating state of the system; typically, other runlevels represent single-user mode (used for repairing a faulty system), system shutdown, and various other states. Switching from one runlevel to another causes a per-runlevel set of scripts to be run, which typically mount filesystems, start or stop
daemons, start or stop the
X Window System, shutdown the machine, etc.
Runlevels The
runlevels in System V describe certain states of a machine, characterized by the processes and daemons running in each of them. In general, there are seven runlevels, out of which three runlevels are considered "standard", as they are essential to the operation of a system: Aside from these standard ones, Unix and Unix-like systems treat runlevels somewhat differently. The common denominator, the /etc/inittab file, defines what each configured runlevel does in a given system.
Default runlevels On Linux distributions defaulting to runlevel 5 in the table on the right, runlevel 5 invokes a multiuser graphical environment running the
X Window System, usually with a
display manager like
GDM or
KDM. However, the
Solaris and
illumos operating systems typically reserve runlevel 5 to shut down and automatically power off the machine. On most systems, all users can check the current runlevel with either the runlevel or
who -r command. The
root user typically changes the current runlevel by running the telinit or init commands. The /etc/inittab file sets the default runlevel with the :initdefault: entry. On Unix systems, changing the runlevel is achieved by starting only the missing services (as each level defines only those that are started / stopped). For example, changing a system from runlevel 3 to 4 might only start the local X server. Going back to runlevel 3, it would be stopped again. == Other implementations ==