如何更改CentOS7的启动级别
在虚拟机新安装了个CentOS7,图形界面启动太慢,想调整一下按照以前的经验改运行级别,输入:
vi /etc/inittab
然后发现跟之前不一样了,在inittab设置不再生效:
1 # inittab is no longer used when using systemd. 2 # 3 # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. 4 # 5 # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target 6 # 7 # systemd uses 'targets' instead of runlevels. By default, there are two main targets: 8 # 9 # multi-user.target: analogous to runlevel 3 10 # graphical.target: analogous to runlevel 5 11 # 12 # To view current default target, run: 13 # systemctl get-default 14 # 15 # To set a default target, run: 16 # systemctl set-default TARGET.target 17 #
仔细读一下上面的提示
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 ~]#
最后重启发现,果然是命令模式~~
转载于Linux公社
转载请标明出处:http://www.cnblogs.com/duzhaoqi/