码迷,mamicode.com
首页 > 其他好文 > 详细

centos 7修改启动级别修改小记

时间:2018-03-12 11:04:36      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:init

安装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修改启动级别修改小记

标签:init

原文地址:http://blog.51cto.com/13323775/2085387

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!