Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Configure Run Levels RHEL 7 or CentOS 7
1. Configure Run Levels on RHEL 7 / CentOS 7
i | P a g e
Table of Contents
Overview.......................................................................................................................................................1
Applies To..................................................................................................................................................1
Run levels......................................................................................................................................................1
System Commands Table..............................................................................................................................1
RunLevel Comparison Table – old and new Method....................................................................................1
Switch to Maintenance Mode...................................................................................................................2
Isolate........................................................................................................................................................2
Switch to multi-user (level 3) mode..........................................................................................................2
Switch to graphical (level 5) mode............................................................................................................3
Set default RunLevel to multi-user mode.................................................................................................3
Set default RunLevel to graphical mode...................................................................................................3
Get current default RunLevel....................................................................................................................4
Poweroff – Server .....................................................................................................................................4
Reboot – Server ........................................................................................................................................4
Halt – Server..............................................................................................................................................4
2. Configure Run Levels on RHEL 7 / CentOS 7
1 | P a g e
Overview
The purpose of this document give insight into Linux Run levels configurations in RHEL 7 / CentOS 7
version.
Applies To
RHEL 7, CentOS 7
Run levels
systemd deals with run levels. As everything is represented by files in systemd, target files replace run
levels.
System Commands Table
Options Purpose
default Enter system default mode
rescue Enter system rescue mode
emergency Enter system emergency mode
halt Shut down and halt the system
poweroff Shut down and power-off the system
reboot Shut down and reboot the system
kexec Shut down and reboot the system with kexec
exit Request user instance exit
switch-root [ROOT] [INIT] Change to a different root file system
suspend Suspend the system
hibernate Hibernate the system
hybrid-sleep Hibernate and suspend the system
RunLevel Comparison Table – old and new Method
Prior to RHEL 7, runlevels were used to identify a set of services that would start or stop when that runlevel
was requested. Now in RHEL 7 onwards, instead of runlevels, systemd uses the concept of targets to
group together sets of services that are started or stopped.
Traditional Runlevel New Target Name Symbolically linked to…
Runlevel 0 runlevel0.target poweroff.target
Runlevel 1 runlevel1.target rescue.target
Runlevel 2 runlevel2.target multi-user.target
Runlevel 3 runlevel3.target multi-user.target
Runlevel 4 runlevel4.target multi-user.target
Runlevel 5 runlevel5.target graphical.target
Runlevel 6 runlevel6.target reboot.target
3. Configure Run Levels on RHEL 7 / CentOS 7
2 | P a g e
Switch to Maintenance Mode
To switch into maintenance mode, run the command
systemctl rescue
ea
Note: Other option is also available emergency target only available when set up in the kernel boot line
(systemd.unit=emergency.target) and for critical situations.
Isolate
The purpose of “Isolate” attribute is to start one unit and stop all others.
Switch to multi-user (level 3) mode
To Switch into multi-user level, which is equivalent to pervious level 3
systemctl isolate multi-user.target
or:
systemctl isolate runlevel3.target
4. Configure Run Levels on RHEL 7 / CentOS 7
3 | P a g e
Switch to graphical (level 5) mode
To Switch into GUI mode, which is equivalent to the previous level 5
systemctl isolate graphical.target
or:
systemctl isolate runlevel5.target
Set default RunLevel to multi-user mode
systemctl set-default multi-user.target
Set default RunLevel to graphical mode
systemctl set-default graphical.target
5. Configure Run Levels on RHEL 7 / CentOS 7
4 | P a g e
Get current default RunLevel
To get / display the currently set default RunLevel.
systemctl get-default
Poweroff – Server
To poweroff the server run the command;
systemctl poweroff
Reboot – Server
To reboot the server with default runlevel, run the command;
systemctl reboot
Halt – Server
To halt the server, run the command;
systemctl halt