Note: This is a RHCSA 7 exam objective.
In the old days
Before Systemd, there were the following runlevels:
- 1, single: maintenance level,
- 2: level without network resources (NFS, etc),
- 3: multi-user level without graphical interface,
- 5: multi-user level with graphical interface.
Note: The default run level was set in the /etc/inittab file.
To get the current run level with the old way, type:
To change the current run level (where X is the run level), type:
# init X
Note: As seen before, levels 0 and 6 were respectively used for halting a system and for rebooting it.
With Systemd, new commands are available:
- systemctl rescue: to move to single user mode/maintenance level with mounted local file systems,
- systemctl emergency: to move to single user mode/maintenance with only /root mounted file system,
- systemctl isolate multi-user.target: to move to multi-user level without graphical interface (equivalent to previous run level 3),
- systemctl isolate graphical.target: to move to multi-user level with graphical interface (equivalent to previous run level 5),
- systemctl set-default graphical.target: to set the default run level to multi-user graphical mode,
- systemctl get-default: to get the default run level.
Make sure you visit the Systemd page.
You can also watch Ralph Nyberg‘s video about Systemd targets (6min/2015).