nginx重启出现“No such process”提示的解决方案

作者:沙师弟时间:2012-05-17
我的vps用的nginx,在更改配置后要重启时出现:
-bash: kill: (4038) - No such process 
刚开始以为是配置问题,直接输入:
/usr/local/nginx/sbin/nginx -t
测试提配置没问题,这是咋回事呢?难道是nginx没启动,开始网站还可以访问,用top命令查看,进程也在,怎么解决问题呢?干掉nginx进程再重启试试:
killall nginx
提示我出错,晕菜,这样也错,直接用:
kill 20230 (20230是进程id)
干掉所有nginx进程后,再重启nginx:
/usr/local/nginx/sbin/nginx
提示:
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()
其实我刚开始也是用的这个命令,但是重启之后这个提示:
-bash: kill: (4038) - No such process 
不放心,这样到底有没有成功,用:
/usr/local/nginx/sbin/nginx -s reload
重新重启了一遍,没发生任何错误,只能感叹linux真难搞,特别是像俺这种新手。