运行级别
| init | systemctl | 说明 |
|---|---|---|
| 0 | shutdown.target | 关机 |
| 1 | emergency.target | 单用户模式(root) |
| 2 | rescure.target | 多用户模式(无NFS) |
| 3 | multi-user.target | 完整的多用户模式 |
| 4 | 无 | 系统未使用,给用户自定义 |
| 5 | graphical.target | GUI图形模式 |
| 6 | 无 | 重启 |
init
原理:/etc/rc.d/下的脚本程序启动指定运行级别该启动的服务。
格式
init 运行级别实例
init 3 # 进入完整的多用户模式
init 5 # 进入图形化界面默认
更改/etc/inittab文件里的数字
systemctl
详见 systemd
格式
systemctl isolate 运行级别实例
systemctl isolate multi-user.target # 进入完整的多用户模式
systemctl isolate graphical.target # 进入图形化界面默认
systemctl get-default
# 查看当前默认的运行级别
systemctl set-default 运行级别
# 设置默认的运行级别查看当前运行级别和默认运行级别
命令
runlevel输出
N 3
# 表示当前处于默认运行级别3
3 5
# 表示默认运行级别为3,当前运行级别为5