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 # ~ ~
比如我這個虛擬機:
其他命令 都應該可以處理.