chkconfigはsystemctlに変更(CentOS7~)

この記事は、CentOS7以降を対象としています。
CentOS6までは、SysV Initが利用されていましたが、CentOS7からはsystemdをになりました。
サービス一覧や停止や起動、自動起動設定などのコマンドが変更されたのでまとめてみました。

関連記事

chkconfig -> systemctl 一覧

内容
自動起動設定chkconfig サービス名 onsystemctl enable サービス名
自動起動を無効化chkconfig サービス名 offsystemctl disable サービス名
状態確認chkconfig --listsystemctl list-unit-files
サービスの状態を表示するservice サービス名 statussystemctl status サービス名
サービスを起動するservice サービス名 startsystemctl start サービス名
サービスを停止するservice サービス名 stopsystemctl stop サービス名
サービスを再起動するservice サービス名 restartsystemctl restart サービス名
設定の再読み込みservice サービス名 reloadsystemctl reload サービス名

serviceタイプのユニットは拡張子(.service)が省略可能。

その他

以上、chkconfigからsystemctlの対応の一覧でした。


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2025-03-13 (木) 20:29:14