After modifying the configuration file, nginx: [error] invalid PID number “” in/data/nginx/logs/nginx. PID “appears during restart. This means that a valid PID (process number) cannot be found in the file/data/nginx/logs/nginx. PID
Solution 1: find the PID of nginx’s main process number, write it into nginx.pid file, and restart 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 ~]#
Solution 2: kill the nginx main process and restart nginx
[root@yzil ~]# killall nginx
[root@yzil ~]# nginx
Read More:
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- nginx: [error] invalid PID number in /var/run/nginx.pid
- nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- Nginx startup error: nginx: [error] open() “/ var / run / nginx/ nginx.pid The solution of “failed (2: no such file or directory)”
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
- /var/run/nginx/nginx.pid” failed (2: No such file or directory)
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- nginx: open() “/var/run/nginx.pid“ failed (2: No such file or directory)
- nginx: [error] open() “/usr/local/var/run/nginx.pid” failed (2: No such file or directory)
- Solve the problem of starting nginx nginx.pid error
- Nginx start error: job for nginx.service failed because the control process exited with error code
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Nginx installation in MAC
- socket.error : [errno 10048] and view PID process number and port number
- Plug in loaded: fastmirror, langpacks / var / run/ yum.pid Locked, another program with PID 2323 is running
- The garbled problem of hot deployment in nginx
- Nginx can’t successfully reload
- Implementation of HTTPS file server based on nginx in win2012
- nginx: [emerg] unknown directive “proxy_pass“