chkconfig

提供: セキュリティ
移動: 案内検索
スポンサーリンク

chkconfig とは、システムサービスのランレベルの情報の確認や更新をするためのコマンドです。

読み方

chkconfig
ちぇっく こんふぃぐ

概要

ランレベル によって、起動されるサービスが違います。 ランレベルごとにディレクトリ ( /etc/rc.d/rc?.d ) があります。 各ランレベルのディレクトリには、起動スクリプトへのシンボリックリンクがあります。 システム管理者は、 /etc/rc.d ディレクトリのシンボリックリンクを 直接操作せず、 chkconfig を通して、操作します。


使い方

すべてのシステムサービスを表示する

$ chkconfig
NetworkManager  0:off   1:off   2:on    3:on    4:on    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
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
avahi-daemon    0:off   1:off   2:off   3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
bluetooth       0:off   1:off   2:off   3:on    4:on    5:on    6:off
cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off
dnsmasq         0:off   1:off   2:off   3:off   4:off   5:off   6:off
 
省略

特定のサービスだけを表示する

$ chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

サービスをon / off する

この例では、iptables を on にします。

$ chkconfig iptables on

この例では、iptables を off にします。

$ chkconfig iptables on

デフォルトでは、on/off の設定は、ランレベル 3,4,5 に影響があります。 reset は、すべてのランレベル に効力を発揮します。

ランレベル を指定する場合は、 --level オプションを使用します。

chkconfig --level 5 iptalbe on

ランレベル 3 と 5 を指定する場合には、35 となります。

chkconfig --level 35 iptalbe on

reset は、起動スクリプト内に記述されているデフォルトの設定を使用します。

chkconfig iptables reset

サービスを追加する

$ chkconfig --add foo

サービスを削除する

$ chkconfig --del foo

関連項目




スポンサーリンク