在Ubuntu Minimal系统中,重启服务主要使用systemctl命令(适用于systemd服务管理器,Ubuntu 16.04及更高版本默认使用),具体操作如下:
重启指定服务
sudo systemctl restart <服务名> 例如重启Nginx服务:
sudo systemctl restart nginx 查看服务状态(可选)
重启前建议先确认服务状态,确保操作必要性:
sudo systemctl status <服务名> 其他常用操作
sudo systemctl start <服务名>sudo systemctl stop <服务名>sudo systemctl enable <服务名>sudo systemctl disable <服务名>注意:
service命令(如Ubuntu 14.04),但推荐优先使用systemctl。sudo),重启服务可能导致短暂中断,建议在低峰时段操作。