#navi(../)
* chkconfigはsystemctlに変更(CentOS7~) [#pe0b935e]
&color(red){この記事は、CentOS7以降を対象としています。};~
CentOS6までは、SysV Initが利用されていましたが、CentOS7からはsystemdをになりました。~
サービス一覧や停止や起動、自動起動設定などのコマンドが変更されたのでまとめてみました。

#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)

* 関連記事 [#dcc9fd73]
-[[CentOS7でランレベルを変更する方法>CentOS/CentOS7でランレベルを変更する方法]]
-[[chkconfigはsystemctlに変更(CentOS7~)>CentOS/chkconfigはsystemctlに変更]]
-[[systemdでunit一覧を確認する方法>CentOS/systemdでunit一覧を確認する方法]]
-[[systemdのserviceタイプ一覧を表示する方法>systemd/systemdのserviceタイプ一覧を表示する方法]]

* chkconfig -> systemctl 一覧 [#pd7d040d]


|内容|旧|新|
|自動起動設定|chkconfig サービス名 on|systemctl enable サービス名|
|自動起動を無効化|chkconfig サービス名 off|systemctl disable サービス名|
|状態確認|chkconfig --list|systemctl list-unit-files|
|サービスの状態を表示する|service サービス名 status|systemctl status サービス名|
|サービスを起動する|service サービス名 start|systemctl start サービス名|
|サービスを停止する|service サービス名 stop|systemctl stop サービス名|
|サービスを再起動する|service サービス名 restart|systemctl restart サービス名|
|設定の再読み込み|service サービス名 reload|systemctl reload サービス名|

serviceタイプのユニットは拡張子(.service)が省略可能。~
-例
 systemctl start httpd.service → systemctl start httpd

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

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

#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS