RHCSA Exam Objectives: How to Boot systems into different targets manually
In this lesson we are going to learn how to boot systems into different targets manually on the Red Hat Enterprise 7 server (RHEL)
Runlevel | Target Units | Description |
---|---|---|
0 | runlevel0.target, poweroff.target | Shut down and power off the system. |
1 | runlevel1.target, rescue.target | Set up a rescue shell. |
2 | runlevel2.target, multi-user.target | Set up a non-graphical multi-user system. |
3 | runlevel3.target, multi-user.target | Set up a non-graphical multi-user system. |
4 | runlevel4.target, multi-user.target | Set up a non-graphical multi-user system. |
5 | runlevel5.target, graphical.target | Set up a graphical multi-user system. |
6 | runlevel6.target, reboot.target | Shut down and reboot the system. |
Viewing the Default Target
To determine which target unit is used by default, run the following command:
# systemctl get-default
Viewing the Current Target
To list all currently loaded target units, type one of the following commands:
# systemctl list-units --type target # systemctl list-units --type target --all
Changing the Default Target
– To configure the system to use a different target unit by default use the following command:
# systemctl set-default name.target
Replace name with the name of the target unit you want to use by default.
Example:
[[email protected] ~]# systemctl set-default multi-user.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target. [[email protected] ~]#
Changing the Current Target
To change to a different target unit in the current session, type the following command:
# systemctl isolate name.target
Replace name with the name of the target unit you want
Example 1:To turn off the graphical user interface and change to the multi-user.target
[[email protected] ~]# systemctl isolate multi-user.target
Example 2:Changing to Rescue Mode
[[email protected] ~]# systemctl isolate rescue.target
Notice here, that we can use other commands to do the same task:
[[email protected] ~]# systemctl rescue [[email protected] ~]# systemctl --no-wall rescue #this command will not send message to currently logged users
Example 2:Changing to Emergency Mode
[[email protected] ~]# systemctl isolate emergency.target
Notice here, that we can use other commands to do the same task:
[[email protected] ~]# systemctl emergency [[email protected] ~]# systemctl --no-wall emergency #this command will not send message to currently logged users
PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks.