感谢支持
我们一直在努力

CentOS7修改默认运行级别

在虚拟机新安装了个CentOS7,图形界面启动太慢,想调整一下按照以前的经验改运行级别,输入:

vi /etc/inittab

然后发现跟之前不一样了,在inittab设置不再生效:

# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses ‘targets’ instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#

仔细读一下上面的提示
multi-user.target 类似与之前的runlevel 3
graphical.target 类似与之前的runlevel 5

按照上面的提示,查看当前的默认target输入命令:

[root@localhost ~]# systemctl get-default
graphical.target
[root@localhost ~]#
当前为graphical.target

修改为命令模式multi-user.target:

[root@localhost ~]# systemctl set-default multi-user.target
rm ‘/etc/systemd/system/default.target’
ln -s ‘/usr/lib/systemd/system/multi-user.target’ ‘/etc/systemd/system/default.target’
[root@localhost ~]#

查看一下当前,发现得到预期要求:

[root@localhost ~]# systemctl get-default
multi-user.target
[root@localhost ~]#

最后重启发现,果然是命令模式~~

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-04/130558.htm

赞(0) 打赏
转载请注明出处:服务器评测 » CentOS7修改默认运行级别
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏