Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RHEL7.x version, runlevel modification

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report