CentOS7 Systemdによるシステムサービス管理入門

CentOS7では、以下のコマンドを使ってシステムサービスを管理することができます:

  1. サービスを起動する。
sudo systemctl start <service_name>
  1. サービスを中止します。
sudo systemctl stop <service_name>
  1. サービスを再起動する。
sudo systemctl restart <service_name>
  1. サービスのステータスを確認する:
sudo systemctl status <service_name>
  1. 起動時に自動起動するように設定する:
sudo systemctl enable <service_name>
  1. 起動時の自動起動を禁止する。
sudo systemctl disable <service_name>
  1. すべての起動されているサービスを確認する:
systemctl list-units --type=service
  1. すべてのロードされたサービスを確認する:
systemctl list-unit-files --type=service

上記のコマンドを使用することで、CentOS7システムのさまざまなサービスを簡単に管理することができます。

bannerAds