chkconfig コマンド
LINUX よく使う基本コマンド
| chkconfig コマンド サービスの登録、削除、サービスの起動を制御する |
| 文法 |
| chkconfig [オプション] サービス名 |
| chkconfig コマンドは、Linux がシステム起動時に起動するサービスを一覧表示したり、サービスの登録、 削除、サービスの起動をランレベル毎に細かく制御するコマンドです。 また、chkconfig コマンドを実行するにはスーパーユーザー(root)権限が必要になります。 |
| よく使うオプション |
| --list サービスを一覧表示します。 --add サービスを登録します。 --del サービスを削除します。 -h chkconfig コマンドのヘルプを表示します。 -v chkconfig コマンドのバージョンの表示をします。 --level [ランレベル] サービス名 ランレベル毎にサービスのon/off を設定します。 |
| 使用例・・・サービスを一覧表示する |
| # 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 ![]() |
| 使用例・・・サービスを登録する |
| # chkconfig --add proftpd |
| 使用例・・・サービスを削除する |
| # chkconfig --del proftpd |
| 使用例・・・ランレベル毎にサービスのon/off を設定する |
| # chkconfig --level 2345 netfs off # chkconfig --level 2345 netfs on |

