このエントリーをはてなブックマークに追加


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)が省略可能。

  • systemctl start httpd.service → systemctl start httpd

その他

  • 依存関係を表示する
    systemctl list-dependencies サービス名
  • 全ユニットを表示する
    systemctl list-units
  • サービス一覧の表示
    systemctl --type service
  • 強制終了
    systemctl kill -s 9 サービス名

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



トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-04-19 (日) 16:50:43