新裝了一個虛擬機,圖形界面啓動太慢,想調整一下按照之前的經驗改運行級別,輸入:vim
vim /etc/inittab
而後發現跟以前不同了,在inittab設置再也不生效:ide
# 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-defaultgraphical.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 ~]#
查看一下當前,發現獲得預期要求:spa
[root@localhost ~]# systemctl get-defaultmulti-user.target [root@localhost ~]#
最後重啓發現,果真是命令模式code