在 Ubuntu 中,“重启进程”通常分几种情况,下面按最常见场景给你说明:
绝大多数服务都通过这种方式管理(如 nginx、mysql、docker 等)。
systemctl status 服务名
sudo systemctl restart 服务名
示例:
sudo systemctl restart nginx
sudo systemctl stop 服务名 # 停止
sudo systemctl start 服务名 # 启动
sudo systemctl reload 服务名 # 重新加载配置(不中断服务)
ps aux | grep 进程名
或
pgrep 进程名
kill PID
如果杀不掉:
kill -9 PID
./程序名 &
或
nohup 程序名 &
如果你装了 supervisor:
sudo supervisorctl restart 进程名
xkill
然后点击卡死的窗口即可。
sudo reboot
如果你能告诉我:
我可以给你精确的重启方式。