系统相关
首页 > 系统相关> > 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服务状态
在这里插入图片描述

标签:node02,run,service,Nginx,nginx,systemctl,报错,root
来源: https://blog.csdn.net/XY0918ZWQ/article/details/114165979