Skip to main content
In this lesson, we’ll cover how to manage runlevels with SysV init, configure boot targets, and perform system shutdown or reboot. Controlling which services start or stop is essential for Linux administration—whether you’re running web servers, mail daemons, or network services.

SysV init and Runlevels

On SysV-based systems, /sbin/init (PID 1) manages services through predefined runlevels (0–6). Each runlevel corresponds to a different system state:
The image is a text-based explanation of SysVinit runlevels, detailing their purposes and functions, such as system shutdown, single-user mode, and multi-user modes. It also mentions the role of /sbin/init in managing runlevels and services.
Runlevels and their associated services are defined in two places:
  • /etc/inittab: Specifies which scripts or processes to start at each runlevel
  • /etc/init.d/: Contains the actual service scripts

Common /etc/inittab Actions

The image is a text-based explanation of SysVinit configuration files and runlevels, detailing the purpose of /etc/inittab and /etc/init.d/, along with descriptions of boot actions.

Editing /etc/inittab

Before making changes, back up the file:
Open it in your favorite editor:
A typical configuration might include:
After editing /etc/inittab, reload init’s configuration without rebooting:

Init Scripts and Service Directories

Service scripts live in /etc/init.d/, while each runlevel directory in /etc/rc*.d/ contains symlinks:
Within each rcN.d directory, file prefixes determine actions: Example for runlevel 3:

Checking and Changing Runlevels

  • Show current and previous runlevels:
  • Switch to single-user mode (runlevel 1):
  • Reboot using runlevel 6:
  • Halt using runlevel 0:
Switching runlevels will start or stop multiple services. Always save your work and notify other users before changing to runlevels 0, 1, or 6.

Further Reading

Watch Video