Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

The init command traditionally boots a Linux system to a specific system
state, commonly referred to as its runlevel.


Runlevels determine which of the many available system services are started,
as well as in which order they start. A special runlevel is used to stop the
system, and a special runlevel is used for system maintenance. As you will
see, there are other runlevels for special purposes.


You traditionally use runlevels to manage the system services running on a
Linux computer. All these special files and scripts are set up during
installation, but you can change and control them manually.


With the integration of systemd, much of the interest and concern about
runlevels is unnecessary because systemd replaces much of the


functionality previously performed by runlevels. For example, you don’t even
see the runlevel concept used anymore, but instead you hear generic terms
like booting into the default.target, multi-user.target,
graphical.target, or reboot.target. This information remains in
the book for historic context, but most users can simply skim the runlevel
sections.


Runlevel Definitions


The runlevels are defined in a traditional Linux system in /etc/init.d.
Some distributions use the traditional /etc/inittab file to manage boot
services. Ubuntu has not used this file for several years. Because it is not
standard in Ubuntu, this book does not cover /etc/inittab.


Each runlevel tells the init command what services to start or stop.
Although runlevels might all have custom definitions, Ubuntu has adopted
some standards:


Runlevel    0—Known as  “halt,” this    runlevel    shuts   down    the system.
Runlevel 1—This is a special runlevel, defined as “single,” which boots
Ubuntu to a root access shell prompt, where only the root user may log
in. It has networking, X, and multiuser access turned off. This is the
maintenance or rescue mode. It enables the system administrator to
perform work on the system, make backups, and repair configuration or
other files.
Runlevels 2–5—These runlevels aren’t used in Ubuntu in any way that
distinguishes them from each other, but they are often used in other
Linux distributions.
Free download pdf