歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> linux系統查看各類服務及改變服務狀態解決

linux系統查看各類服務及改變服務狀態解決

日期:2017/3/3 11:14:50   编辑:Linux技術

查詢、更新系統服務狀態及運行級別

參數:

[root@ndnp /]# chkconfig --help

chkconfig version 1.3.49.3 - Copyright (C) 1997-2000 Red Hat, Inc.

This may be freely redistributed under the terms of the GNU Public License.

usage: chkconfig [--list] [--type <type>] [name]

chkconfig --add <name> //增加系統服務

chkconfig --del <name> //刪除

chkconfig --override <name>

chkconfig [--level <levels>] [--type <type>] <name> <on|off|reset|resetpriorities> //等級代號

對於等級代號:chkconfig --level

---------------------------------------

等級0表示:表示關機

等級1表示:單用戶模式

等級2表示:無網絡連接的多用戶命令行模式

等級3表示:有網絡連接的多用戶命令行模式

等級4表示:不可用

等級5表示:帶圖形界面的多用戶模式

等級6表示:重新啟動

如:

[root@ndnp /]# chkconfig --list

NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off

abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off

abrt-oops 0:off 1:off 2:off 3:on 4:off 5:on 6:off

abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off

atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

改變狀態做為示例:

前:

iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off

切換:

[root@ndnp /]# chkconfig --level 2345 iptables off

後:

[root@ndnp /]# chkconfig --list |grep iptables

iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Copyright © Linux教程網 All Rights Reserved