RHEL7.x version, runlevel modification
Because in the Redhat7.x version, systemd uses the concept of target that is freer than the run level of sysvinit, the setting and switching of the run level of the system is very different from that of Redhat6.x. Here is how to set the default run level of the system and how to switch it when the system is running.
First, set the default running level of the system
Method 1:
Set the default level to 3 (command line mode)
[root@ys /] # ln-sf / lib/systemd/system/multi-user.target / etc/systemd/system/default.target
Set the default level to 5 (graphical interface mode)
[root@ys /] # ln-sf / lib/systemd/system/graphical.target / etc/systemd/system/default.target
Method 2:
Set the default level to 3 (command line mode)
[root@ys /] # systemctl set-default multi-user.target
Set the default level to 5 (graphical interface mode)
[root@ys /] # systemctl set-default graphical.target
Second, in the operation of the system, switch the running level
Method 1:
Switch level to 3 (command line mode)
[root@ys /] # systemctl isolate multi-user.target
[root@ys /] # systemctl isolate runlevel3.target
Set the default level to 3 (graphical interface mode)
[root@ys /] # systemctl isolate graphical.target
[root@ys /] # systemctl isolate runlevel5.target
Method 2:
Init [0123456]
Note: the way to view the current runlevel is
[root@ys /] # runlevel