共計 507 個字符,預計需要花費 2 分鐘才能閱讀完成。
在 Linux 系統中,可以使用 systemd 作為服務管理器來管理服務。以下是一些常用的命令來管理服務:
- 啟動服務:
sudo systemctl start <service_name>
- 停止服務:
sudo systemctl stop <service_name>
- 重啟服務:
sudo systemctl restart <service_name>
- 查看服務狀態:
sudo systemctl status <service_name>
- 開機自啟動:
sudo systemctl enable <service_name>
- 禁止開機自啟動:
sudo systemctl disable <service_name>
- 查看所有已啟動的服務:
systemctl list-units --type=service
- 查看所有已啟用的服務:
systemctl list-unit-files --type=service
- 查看所有服務的狀態:
systemctl list-units --type=service --all
除了 systemd 之外,也可以使用其他工具如 SysVinit 或 Upstart 來管理服務,但 systemd 是目前較為常用的服務管理器。
丸趣 TV 網 – 提供最優質的資源集合!
正文完