CentOS 7 修改启动级别
今天装了一台centos7,像往常一样通过/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
开始有点懵,然后仔细一看这些注释行的意思,瞬间明白了,这个配置文件告诉我们,以前的inittab不再使用,现在使用target控制启动级别,使用方法是:
systemctl get-default #查看默认启动级别
systemctl set-default multi-user.target #设置启动级别为多用户命令行
systemctl set-default graphical.target #设置启动级别为图形界面
顺便介绍下启动级别:
- 0 - 系统停机状态
- 1 - 单用户工作状态
- 2 - 多用户状态(没有NFS)
- 3 - 多用户状态(有NFS)
- 4 - 系统未使用,留给用户
- 5 - 图形界面
- 6 - 系统正常关闭并重新启动
相关推荐
87901735 2020-06-25
changecan 2020-11-19
ECSHOP专属建设 2020-11-13
88427810 2020-11-02
步知道 2020-10-27
Junzizhiai 2020-10-10
jackalwb 2020-10-05
小网管 2020-09-03
shiwenqiang 2020-09-14
85251846 2020-09-14
summerinsist 2020-08-21
87901735 2020-08-19
PinkBean 2020-08-11
85407718 2020-08-09
MichelinMessi 2020-07-30
suosuo 2020-07-28
CARBON 2020-07-28
lizhengfa 2020-07-27
88427810 2020-07-26