kill -9杀掉nginx主进程、reload失败解决办法

前言:

无意间使用 kill -9 命令杀掉了nginx的主进程,当我再次使用 ./nginx -s reload 重新刷新nginx的时候,一直出现了下面的错误信息:

nginx: [alert] kill(27905, 1) failed (3: No such process)

同时,执行命令 ./nginx -t 返回的结果如下:

nginx: the configuration file /opt/nginx-1.4.7/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx-1.4.7/conf/nginx.conf test is successful

nginx正常运行,只是无法使用reload刷新,我也头大了,怎么办呢。

网上找到如下解决方法:

文章地址: http://www.2cto.com/os/201303/198394.html

文章中有一个命令 fuser -n tcp 80  查看80端口被哪些程序占用。最终控制台输出的信息如下:

80/tcp:              4613  4614

好吧,kill掉这2个子进程。

重新启动nginx,再次使用 ./nginx -s reload ,,OK了!

还好没有酿成大祸。。记录下来,以便需要时参考。

原文地址:https://www.cnblogs.com/zhoubang521/p/5200236.html