System V Overview
100%

Init · Lesson 1

System V Overview

Learn how traditional System V init uses runlevels and ordered service-script links.

System V init, usually called SysV init or sysvinit, is a traditional PID 1 and service-startup design. It remains important on legacy systems and through compatibility scripts, but installed SysV-style files do not prove that sysvinit is the running PID 1.

Identifying the Active Init System

Inspect live PID 1:

$ ps -p 1 -o pid,comm,args=
$ readlink /proc/1/exe

An /etc/inittab file or /etc/init.d/ directory is only supporting evidence. systemd and other init systems can retain these files for compatibility, and containers can show a different PID namespace from the host.

What is the strongest evidence that sysvinit is active?

Runlevels

A runlevel is a named numeric operating mode. SysV configurations traditionally use levels 0 through 6 plus special levels, but meanings are distribution policy rather than a universal law. Common conventions include:

  • 0: halt or poweroff transition
  • 1 or S: single-user or rescue mode
  • 2 through 5: distribution-defined multiuser modes
  • 6: reboot transition

Debian-family systems historically treat levels 2–5 similarly, while Red Hat-family conventions distinguish text and graphical modes. Inspect /etc/inittab, init documentation, and runlevel directories on the actual host.

Which runlevel conventionally requests halt or poweroff on many SysV systems?

Init Scripts and Runlevel Links

Service scripts commonly reside under /etc/init.d/. Runlevel directories such as /etc/rc2.d/ or /etc/rc.d/rc2.d/ contain links whose names encode transition action and order:

  • SNNname links request a start action.
  • KNNname links request a stop action.
  • NN provides lexical ordering among links for that transition.

The exact algorithm and directories vary. Dependencies can also be expressed in script headers and processed by distribution tools, and some implementations parallelize work. SysV should not be reduced to a guarantee that every service starts strictly one at a time.

What does an S20networking link conventionally request during entry into a runlevel?

Transitioning Between Runlevels

When init changes runlevel, the distribution's rc machinery stops services no longer needed and starts services required in the new mode. Scripts must be idempotent enough to handle repeated status or transition operations and return meaningful statuses.

Requesting runlevel 0 or 6 is a system-wide destructive availability action. Use the system's shutdown interface, notify users, preserve active work, and verify remote console access rather than invoking raw init transitions casually.

What does runlevel 6 conventionally request?

Limits of Compatibility

On a systemd host, SysV scripts can be wrapped as generated units, but systemd dependencies, timeouts, logging, and state semantics still apply. Running a legacy script directly can bypass the service manager's tracking. Identify the active manager and use its native interface when possible.

Why should a SysV-style script on a systemd host normally be invoked through the service manager?

Lesson complete

You finished System V Overview

You can now interpret a traditional SysV layout without assuming it is active.

  • Identify the live PID 1 before choosing init commands.

  • Treat runlevel meanings as distribution-defined conventions.

  • Read S, K, and numeric ordering in runlevel links.

  • Use controlled shutdown procedures for levels 0 and 6.

  • Respect the active manager when compatibility scripts are present.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Init