In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to switch operating levels under CentOS7". In daily operation, I believe that many people have doubts about how to switch operating levels under CentOS7. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to switch operating levels under CentOS7". Next, please follow the editor to study!
The command to switch from the command line level to the window level remains the same: init 5 or startx
The command to switch from the window level to the command line level remains the same: init 3
The run level of the new version is defined under / lib/systemd/system:
[root@localhost ~] # ls-ltr / lib/systemd/system/runlevel*.target
Lrwxrwxrwx. 1 root root 16 September 10 20:58 / lib/systemd/system/default.target-> graphical.target
Lrwxrwxrwx. 1 root root 13 September 10 20:58 / lib/systemd/system/runlevel1.target-> rescue.target
Lrwxrwxrwx. 1 root root 15 September 10 20:58 / lib/systemd/system/runlevel0.target-> poweroff.target
Lrwxrwxrwx. 1 root root 17 September 10 20:58 / lib/systemd/system/runlevel4.target-> multi-user.target
Lrwxrwxrwx. 1 root root 17 September 10 20:58 / lib/systemd/system/runlevel3.target-> multi-user.target
Lrwxrwxrwx. 1 root root 17 September 10 20:58 / lib/systemd/system/runlevel2.target-> multi-user.target
Lrwxrwxrwx. 1 root root 16 September 10 20:58 / lib/systemd/system/runlevel5.target-> graphical.target
Lrwxrwxrwx. 1 root root 13 September 10 20:58 / lib/systemd/system/runlevel6.target-> reboot.target
You can set different run levels for different needs:
For example, set the command line level (init 3) method:
[root@localhost ~] # ln-svf / lib/systemd/system/runlevel3.target / etc/systemd/system/default.target
Or
[root@localhost ~] # ln-svf / lib/systemd/system/multi-user.target / etc/systemd/system/default.target
Or
[root@localhost ~] # systemctl set-default multi-user.target
Set the window level (init 5) method:
[root@localhost ~] # ln-svf / lib/systemd/system/runlevel5.target / etc/systemd/system/default.target
Or
[root@localhost ~] # ln-svf / lib/systemd/system/graphical.target / etc/systemd/system/default.target
Or
[root@localhost ~] # systemctl set-default graphical.target
-- split line--
Modify the system run level:
1. Systemd uses target, which is freer than the run-level of sysvinit. The third runner is replaced by multi-user.target. The fifth runner is replaced by graphical.target. Runlevel3.target and runlevel5.target are symbolic links to multi-user.target and graphical.target, respectively.
You can switch to runlevel 3 using the following command:
Systemctl isolate multi-user.target or systemctl isolate runlevel3.target
You can switch to runlevel 5 using the following command:
Systemctl isolate graphical.target or systemctl isolate runlevel5.target
2. How to change the default run level?
Systemd uses links to point to the default run level. Before creating a new link, you can delete the existing link with the following command: rm / etc/systemd/system/default.target
Start runlevel 3 by default:
Ln-sf / lib/systemd/system/multi-user.target / etc/systemd/system/default.target
Start runlevel 5 by default:
Ln-sf / lib/systemd/system/graphical.target/etc/systemd/system/default.target
Systemd does not use the / etc/inittab file.
-- split line--
How do I view the current runlevel?
The old runlevel command can still be used under systemd. You can continue to use it, although systemd replaces the runlevel of the previous system with the concept of 'target' (multiple' target' can be activated at the same time).
The equivalent systemd command is systemctl list-units-type=target
At this point, the study on "how to switch the running level under CentOS7" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.