豚吐露@wiki
systemctlを使ったサービス管理
最終更新:
ohden
-
view
systemctlを使ったサービス管理
versions
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秒