[root@hf-01 ~]# chkconfig --list //列出全部的系統服務 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 ~]#
[root@hf-01 ~]# ls /etc/init.d/ functions netconsole network README [root@hf-01 ~]#
[root@hf-01 ~]# chkconfig network off [root@hf-01 ~]# chkconfig --list //會看到2,3,4級別關閉了 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:關 3:關 4:關 5:關 6:關 [root@hf-01 ~]# chkconfig network on [root@hf-01 ~]# chkconfig --list //會看到2,3,4級別又開啓了 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 ~]#
在系統中有七個級別等級列表:mysql
在centos6中的 /etc/inittab 中定義開機的級別nginx
在centos7中,已經沒有用了,不須要定義開機的級別了sql
[root@hf-01 ~]# chkconfig --level 3 network off //指定network中的3級別關閉 [root@hf-01 ~]# chkconfig --list //列出全部服務 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:關 4:開 5:開 6:關 [root@hf-01 ~]#
[root@hf-01 ~]# chkconfig --level 345 network on //指定network中的3,4,5級別開啓 [root@hf-01 ~]# chkconfig --list 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 ~]#
# chkconfig: 2345 10 90 # description: Activates/Deactivates all network interfaces configured to \ # start at boot time.
[root@hf-01 ~]# cd /etc/init.d [root@hf-01 init.d]# ls functions netconsole network README [root@hf-01 init.d]# cp network 123 [root@hf-01 init.d]# ls -l 總用量 40 -rwxr-xr-x 1 root root 7293 12月 5 05:27 123 -rw-r--r--. 1 root root 17500 5月 3 2017 functions -rwxr-xr-x. 1 root root 4334 5月 3 2017 netconsole -rwxr-xr-x. 1 root root 7293 5月 3 2017 network -rw-r--r--. 1 root root 1160 10月 20 11:07 README [root@hf-01 init.d]# chkconfig --list 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 init.d]# chkconfig --add 123 //將123加入到服務列表中 [root@hf-01 init.d]# chkconfig --list 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 123 0:關 1:關 2:開 3:開 4:開 5:開 6:關 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 init.d]# chkconfig --del 123 //刪除服務列表中的腳本 [root@hf-01 init.d]# chkconfig --list 注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置數據可能被原生 systemd 配置覆蓋。 若是您想列出 systemd 服務,請執行 'systemctl list-unit-files'。 欲查看對特定 target 啓用的服務請執行 'systemctl list-dependencies [target]'。 netconsole 0:關 1:關 2:關 3:關 4:關 5:關 6:關 network 0:關 1:關 2:開 3:開 4:開 5:開 6:關 [root@hf-01 init.d]#