[日期:2016-04-23] 來(lái)源:Linux社區(qū)? 作者:sonnychen [字體:大 中 小]
在虛擬機(jī)新安裝了個(gè)CentOS7贾漏,圖形界面啟動(dòng)太慢漱逸,想調(diào)整一下按照以前的經(jīng)驗(yàn)改運(yùn)行級(jí)別钢颂,輸入:
vi /etc/inittab
然后發(fā)現(xiàn)跟之前不一樣了离钝,在inittab設(shè)置不再生效:
# 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
#
仔細(xì)讀一下上面的提示
multi-user.target 類似與之前的runlevel 3
graphical.target 類似與之前的runlevel 5
按照上面的提示穴亏,查看當(dāng)前的默認(rèn)target輸入命令:
[root@localhost ~]# systemctl get-default
graphical.target
[root@localhost ~]#
當(dāng)前為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 ~]#
查看一下當(dāng)前玫锋,發(fā)現(xiàn)得到預(yù)期要求:
[root@localhost ~]# systemctl get-default
multi-user.target
[root@localhost ~]#
最后重啟發(fā)現(xiàn),果然是命令模式~~
更多CentOS相關(guān)信息見CentOS 專題頁(yè)面 http://www.linuxidc.com/topicnews.aspx?tid=14