豚吐露@wiki

systemctlを使ったサービス管理

最終更新:

ohden

- view
管理者のみ編集可

systemctlを使ったサービス管理

versions

Windows 11 24H2
WSL 2.5.9.0
Ubuntu 24.04.2 LTS

systemctl

サービスに対する操作
  • サービス一覧
systemctl list-unit-files --type=service

  • サービス検索
systemctl list-unit-files --type=service | grep 【Keyword】
e.g.) systemctl list-unit-files --type=service | grep ssh

  • サービスの状態
systemctl status 【ServiceName】
e.g.) systemctl status sshd.service

  • サービスを(再)起動する
sudo systemctl start 【ServiceName】
sudo systemctl restart 【ServiceName】
e.g.) sudo systemctl start sshd.service

  • サービスを停止する
sudo systemctl stop 【ServiceName】
e.g.) sudo systemctl stop sshd.service

  • サービスを自動起動を有効化する
sudo systemctl enable 【ServiceName】
e.g.) sudo systemctl enable sshd.service

  • サービスの自動起動を無効化する
sudo systemctl disable 【ServiceName】
e.g.) sudo systemctl disable sshd.service


更新日: 2025年08月04日 (月) 10時18分27秒

名前:
コメント:

すべてのコメントを見る
記事メニュー
ウィキ募集バナー