Apr 29, 2022

Linux Run Levels

Linux changes the run-level:

  • (Old Linux distro) SysV init uses run-level number from 0 to 6.
    • cmdline: init, telinit, who
  • (New Linux distro) systemd init uses systemd targets.
    • cmdline: systemctl 

 

Linux runlevel defines the state of the OS. 

SysV Systemd targetsDescription
0
runlevel0.target
poweroff.target
Halt or shutdown the Linux system
  
runlevel1.target
rescue.target
Single-user text mode (useful for maintenance mode)
2 runlevel2.target
multi-user.target
Not used
3 runlevel3.target
multi-user.target
Full multi-user text mode (used on Linux servers)
4 runlevel4.target
multi-user.target
Not used
5 runlevel5.target
graphical.target
Full multi-user GUI mode. You can use X-based login screen. Useful for Linux desktop
6 runlevel6.target
reboot.target
Reboot Linux system


Comparing the cmdline used.

SysV Systemd Description
runelvel
who -r
systemctl get-default
Show the current runlevel
init 1
systemctl rescue
systemctl emergency
Change the runlevel to single user mode for maintenance
init 3
systemctl multi-user-target Change to multi-user text mode
init 0
systemctl poweroff Poweroff
init 6
systemctl reboot
Reboot

systemctl default Back to default target
init 5
systemctl graphical.target
Change to GUI mode


Links:

  • https://www.cyberciti.biz/tips/linux-changing-run-levels.html