相比7以前的版本,在centos7版本中,設置OS啓動默認進入圖形界面仍是文本界面有了點變化sql
檢查當前默認設置
[root@rems2 ~]# systemctl get-default graphical.target
graphical.target表示開機將默認進入圖形界面centos
設置開機進入文本界面
[root@rems2 ~]# systemctl set-default multi-user.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
- 1
- 2
- 3
反向設置命令相似[systemctl set-default graphical.target]ruby
閱讀/etc/inittab,也能夠發現以下內容centos7
[root@rems2 ~]# cat /etc/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 --->告訴咱們multi-user.target至關於之前的runlevel 3 # graphical.target: analogous to runlevel 5 --->告訴咱們graphical.target至關於之前的runlevel 5 # # To view current default target, run: # systemctl get-default # # To set a default target, run: # systemctl set-default TARGET.target