RHEL7更改默認啓動級別

[root@dbserver ~]# more /etc/inittab ide

# inittab is no longer used when using systemd.spa

#server

# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.get

#it

# Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.targetclass

#sed

# 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 set a default target, run:

#

# ln -sf /lib/systemd/system/<target name>.target /etc/systemd/system/default.target

#

查看當前的啓動運行模式

[root@dbserver ~]# systemctl get-default 

graphical.target


設置默認啓動爲多用戶字符界面:

[root@dbserver ~]# 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@dbserver ~]# systemctl get-default 

multi-user.target  字符模式

[root@dbserver ~]#


設置默認啓動爲多用戶圖形界面: 

[root@dbserver ~]# systemctl set-default graphical.target 

rm '/etc/systemd/system/default.target'

ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'

[root@dbserver ~]#


查看默認啓動的運行模式:

[root@dbserver ~]# systemctl get-default 

graphical.target  圖形模式

[root@dbserver ~]# 


從字符界面切換到圖形界面:

方法1:執行#startx

方法2:執行#systemctl  isolate graphical.target

總結:能夠看到更改默認級別的操做即先刪除當前默認配置文件,而後再建立連接文件便可。

相關文章
相關標籤/搜索