CentOS7 修改 启动级别

1. centos7 之前应该使用init 的启动脚本 不支持并行 速度比较慢, centos7 开始使用systemd 的模式 提高了开机的性能

所以之前的init 脚本修改 启动级别应该就无效了

之前的启动级别定义为:

0 - 系统停机状态
1 - 单用户工作状态
2 - 多用户状态(没有NFS)
3 - 多用户状态(有NFS)
4 - 系统未使用,留给用户
5 - 图形界面
6 - 系统正常关闭并重新启动

这里面注意一点 init 6 

不能输入到之前的控制文件中 不然就会循环启动... 

2. 到了centos7 先看一下配置文件

因为兼容性 可以打开 之前的 /etc/inittab配置文件看一下

vim /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
#
~                                                                                                                                                                                                                                                                             
~                                      

比如我这个虚拟机:

其他命令 都应该可以处理.

原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/10080919.html