运行级别 | 含 义 |
---|---|
0 | 关机 |
1 | 单用户模式,可以想象为 Windows 的安全模式,主要用于系统修复 |
2 | 不完全的命令行模式,不含 NFS 服务 |
3 | 完全的命令行模式,就是标准字符界面 |
4 | 系统保留 |
5 | 图形模式 |
6 | 重新启动 |
[root@localhost ~]# runlevel
N 3
#N代表在进入这个级别前,上一个级别是什么;3代表当前级别
[root@localhost ~]# runlevel
5 3
#代表由5级别进入3级别
[root@localhost ~]# init 5
#进入图形界面,当然要已经安装了图形界面才可以
[root@localhost ~]# init 0
#关机
[root@localhost ~]# init 6
#重新启动
[root@localhost ~]#vim /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#系统会先调用/etc/init/rcS.conf
# Individual runlevels are started by /etc/init/rc.conf
#在调用/etc/init/rc.conf,在不同的运行级别启动不同的服务
# Ctrl-Alt-Delete is handled by/etc/init/control-alt-delete.conf
#通过这个配置文件判断Ctri+Alt+Delete热启动键是否可用
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#判断系统可以启动的本地终端数量及终端的基本设置(如颜色)
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5-X11
# 6 - reboot (Do NOT set initdefault to this)
#很眼熟吧,就是刚刚的 0~6运行级别的说明
id:3:initdefault:
#这就是系统的默认运行级别,也就是系统开机后直接进入哪个运行级别
本文链接:http://task.lmcjl.com/news/12114.html