chkconfig と systemctl コマンド互換表

サービス自動起動設定(ブート時)
目的 chkconfig コマンド (古い) systemctl コマンド (新しい) 説明
サービスの自動起動を有効にする chkconfig [サービス名] on systemctl enable [サービス名] 次回起動時からサービスが自動的に開始されるよう設定します。
サービスの自動起動を無効にする chkconfig [サービス名] off systemctl disable [サービス名] 次回起動時からサービスが自動的に開始されないよう設定します。
特定のランレベルで自動起動を有効にする chkconfig --level [ランレベル] [サービス名] on (直接の同等コマンドはなし)
※ターゲットユニットを操作する
SystemDではランレベルの概念が薄く、代わりに「ターゲットユニット」を使用します。
サービス実行中の操作
目的 service コマンド (古い) systemctl コマンド (新しい) 説明
サービスの状態を確認 service [サービス名] status systemctl status [サービス名] サービスが実行中か、停止しているかなどを表示します。
サービスを開始 service [サービス名] start systemctl start [サービス名] サービスを今すぐ起動します。
サービスを停止 service [サービス名] stop systemctl stop [サービス名] サービスを今すぐ停止します。
サービスを再起動 service [サービス名] restart systemctl restart [サービス名] サービスを停止し、その後起動します。設定変更後に使われます。
サービス設定をリロード service [サービス名] reload systemctl reload [サービス名] サービスを再起動せずに設定ファイルを再読み込みさせます。
サービスの一覧表示
目的 chkconfig コマンド (古い) systemctl コマンド (新しい) 説明
全てのサービスの一覧と状態を表示 chkconfig --list systemctl list-unit-files --type=service
systemctl list-units --type=service
`list-unit-files` はサービスファイルの定義状態を、`list-units` は現在の実行状態を表示します。
Visited 148 times, 1 visit(s) today

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です