centos 7修改启动级别修改小记
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 7修改启动级别修改小记相关的知识,希望对你有一定的参考价值。
安装GNOME桌面后想设置默认启动桌面环境,结果发现centos 7的/etc/inittab文件和centos 6不一样了,特记录centos 7设置开机启动级别方法。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
# 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
通过该文件可以看出centos 7 用targets代替了启动级别的设置
multi-user.target类似于 级别3
graphical.target类似于 级别5
获取当前运行级别
systemctl get-default
设置运行级别为3
systemctl set-default multi-user.target
设置运行级别为5
systemctl set-default graphical.target
以上是关于centos 7修改启动级别修改小记的主要内容,如果未能解决你的问题,请参考以下文章