RHEL7更改默认启动级别

[root@dbserver ~]# more /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 /etc/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 set a default target, run:

#

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

#

fmc:2345:respawn:/opt/ibm/db2/V10.5/bin/db2fmcd #DB2 Fault Monitor Coordinator

[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

总结:可以看到更改默认级别的操作即先删除当前默认配置文件,然后再创建链接文件即可。

相关文章
相关标签/搜索