3.3.3 改变目标(运行级别)—— RHEL7 / CentOS7


4.使用命令切换运行级别/目标

# systemctl isolate multi-user.target //切换到运行级别3,该命令对下次启动无影响,等价于telinit 3

# systemctl isolate runlevel3.target //切换到运行级别3,该命令对下次启动无影响,等价于telinit 3

# systemctl isolate graphical.target //切换到运行级别5,该命令对下次启动无影响,等价于telinit 5

# systemctl isolate runlevel5.target //切换到运行级别5,该命令对下次启动无影响,等价于telinit 5

5.修改默认运行级别/目标

可以执行下面命令,设置启动时默认进入文本模式或图形模式。

# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target //文字模式

# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target //图形模式

开机启动进的目标是default.target,默认链接到graphical.target(大致相当于原来的运行级别5)。可以通过内核参数更改默认运行级别(见第1章)。

也可以执行systemctl命令,设置启动时默认进入文本模式或图形模式。

# systemctl -f enable multi-user.target //文字模式

# systemctl -f enable graphical.target //图形模式


<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(1915) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
原文地址:https://www.cnblogs.com/ztguang/p/12648671.html