systemctl
是一個(gè)用于管理 systemd 系統(tǒng)和服務(wù)的命令行工具
systemctl list-units --type=service
sudo systemctl start<service_name>
sudo systemctl stop<service_name>
sudo systemctl restart<service_name>
systemctl status<service_name>
sudo systemctl enable<service_name>
sudo systemctl disable<service_name>
systemctl is-enabled<service_name>
sudo systemctl reload<service_name>
journalctl -u<service_name>
systemctl --failed
sudo systemctl reset-failed
這些是 systemctl
命令的一些常見用法。請注意,執(zhí)行需要管理員權(quán)限的操作(如啟動(dòng)、停止或重啟服務(wù))時(shí),需要使用 sudo
命令。