Pcornel
Linux · Boot Process

Runlevels

Cheat sheet · https://pcornel.dk/topic.php?topic=2735

Back to the Topic

Answer

Runlevels are the SysV-init way of describing system states (0 halt, 1 single-user, 3 multi-user, 5 graphical, 6 reboot). systemd maps them to targets (runlevel3.target = multi-user.target).

Remember

Use targets on modern systems: systemctl isolate multi-user.target instead of init 3, systemctl set-default instead of editing /etc/inittab. runlevel still reports the equivalent.

First checks

  • systemd-analyze — boot time per stage
  • journalctl -b -p err — errors in this boot
  • journalctl --list-boots — previous boots
  • cat /proc/cmdline — kernel command line used

Commands

systemctl get-default
systemctl list-units --type=target
systemctl isolate multi-user.target
systemctl set-default multi-user.target
systemctl enable <svc>
systemctl restart <svc>

Verify in this order

runlevel number → mapped to a systemd target → target units started

Where it usually breaks

First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2735

Confirmation

Confirm action

Continue?