在大多数的linux发行版本中,通常有8个 runlevel

Runlevel System State

0 Halt the system

1 Single user mode

2 Basic multi user mode

3 Multi user mode

5 Multi user mode with GUI

6 Reboot the system

S, s Single user mode

可以在文件 /etc/inittab 中查看

[root@wode003 ~]# cat/etc/inittab 

-bash: cat/etc/inittab: 没有那个文件或目录

[root@wode003 ~]# 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

#

// get-default

[root@wode003 ~]# systemctl get-default

graphical.target

// set-default

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

multi-user.target

[root@wode003 ~]# 

以上就是深入解析CentOS 7.1的运行级别与开机模式的详细内容,更多请关注小闻网其它相关文章

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。