Loading...

Lab 8: Identify and Change Default Runlevel (SysV Systems)

Identify the current SysV runlevel and switch targets during runtime. Then locate the configuration responsible for the default runlevel to make the change persist across boots.

boot services troubleshooting

Scenario

You’re working on an older Debian system using SysV init. The system boots into a graphical environment, but your team needs it to boot into multi-user mode without GUI (runlevel 3).

Operator context

This is the kind of change you make for headless servers, recovery situations, or systems where the GUI adds boot time and operational risk.

Objective

  • Identify the current runlevel.
  • Verify runlevel state using more than one command.
  • Inspect runlevel-specific service symlinks.
  • Switch to runlevel 3 during runtime.
  • Identify where the default runlevel is configured.
  • Switch back to graphical mode (runlevel 5).

What You’ll Practice

  • Checking runlevel state using runlevel and who -r .
  • Inspecting SysV service symlinks in /etc/rc3.d/ .
  • Switching runlevels using init / telinit .
  • Identifying the default runlevel configuration file: /etc/inittab .

Walkthrough

Step 1 : Show the current runlevel.
Command
runlevel
N 5
Step 2 : Confirm runlevel via an alternate command.
Command
who -r
run-level 5  2025-07-18 13:14
Step 3 : Inspect services for runlevel 3.
Command
ls /etc/rc3.d/
S01rsyslog  S02networking  S03cron  K01gdm3
Step 4 : Switch to runlevel 3 immediately.
Command
init 3
Alternative
telinit 3
Switching to runlevel 3...
[ OK ] Stopping graphical interface manager
[ OK ] Starting multi-user services
Step 5 : Identify the default runlevel config file.
File
/etc/inittab
# The default runlevel.
id:3:initdefault:
Step 6 : Return to graphical mode (runlevel 5).
Command
init 5
Alternative
telinit 5
Switching to runlevel 5...
[ OK ] Starting graphical interface manager

Reference

  • runlevel : Shows previous and current SysV runlevel.
  • who -r : Displays runlevel and time of last runlevel change.
  • /etc/rc3.d/ : SysV runlevel directory containing service symlinks for runlevel 3.
  • init <N> / telinit <N> : Switches runlevels immediately.
  • /etc/inittab : Defines the default runlevel in SysV init systems.