一、出现问题的原因

Nginx 运行状态中报错 Can‘t open PID file /var/run/nginx.pid (yet?) after start: No such...ctory  解决办法_运维

Nginx自身Bug问题,导致Nginx服务优化后出现“Can’t open PID file /var/run/nginx.pid (yet?) after start: No such…ctory”报错

二、解决办法

[root@node02 ~]# mkdir -p /etc/systemd/system/nginx.service.d
[root@node02 ~]# vim /etc/systemd/system/nginx.service.d/override.conf
[Service]
ExecStartPost=/bin/sleep 0.1
[root@node02 ~]# systemctl restart nginx
Warning: nginx.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[root@node02 ~]# systemctl daemon-reload
[root@node02 ~]# systemctl restart nginx

查看nginx服务状态

Nginx 运行状态中报错 Can‘t open PID file /var/run/nginx.pid (yet?) after start: No such...ctory  解决办法_Web集群_02