nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“
Posted y_zilong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“相关的知识,希望对你有一定的参考价值。
nginx修改配置文件后,重启时出现 nginx: [error] invalid PID number "" in "/data/nginx/logs/nginx.pid" 。意思是说不能在文件/data/nginx/logs/nginx.pid中找到有效的PID(进程号)
解决方法1:找到nginx的主进程号的pid写入nginx.pid文件,重新启动nginx
[root@yzil ~]# nginx -s reload
nginx: [error] invalid PID number "" in "/data/nginx/logs/nginx.pid"
[root@yzil ~]# ps aux | grep "nginx: master" | grep -v pts | awk '{print $2;}'
2847
[root@yzil ~]# ps aux | grep "nginx: master" | grep -v pts | awk '{print $2;}' > /data/nginx/logs/nginx.pid
[root@yzil ~]# nginx -s reload
[root@yzil ~]#
解决方法2:杀死nginx主进程,重新启动nginx
[root@yzil ~]# killall nginx
[root@yzil ~]# nginx
以上是关于nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“的主要内容,如果未能解决你的问题,请参考以下文章
nginx: [error] invalid PID number "" in "/run/ngin
nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“
nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”
nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"
nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"
解决 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"