问题描述
安装完成linux启动成功,但是停止nginx却出现:nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)这个问题
多次执行:"./nginx -s stop" 无效
执行:"./nginx -s reload"也无效
解决方法
1.后查看nginx当前进程
ps -ef | grep nginx
[root sbin]# ps -ef | grep nginx
root 4807 1 0 Feb23 ? 00:00:00 nginx: master process ./nginx
nobody 4855 4807 0 Feb23 ? 00:00:00 nginx: worker process
root 29411 18450 0 11:31 pts/1 00:00:00 grep --color=auto nginx
2.并将nginx出现的进程用kill-9 杀死
3.同时在/conf/nginx.conf中将pid注释的那一行放行
重新执行./nginx启动和./nginx -s stop指令,发现一切ok