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

一、出现问题的原因

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集群案例实战 -- Keepalived 实现 web 服务高可用


下一篇:ClickHouse集群搭建(二)