红联Linux门户
Linux帮助

nginx提示Failed to read PID from file /run/nginx.pid的解决

发布时间:2017-05-27 14:46:20来源:linux网站作者:katios
笔者在centos7上,配置nginx代理服务后:
systemctl status nginx.service
 
提示错误:
Failed to read PID from file /run/nginx.pid: Invalid argument
 
看到好多说删掉改nginx.pid 文件的,试之,无效。
 
后来找到了一个方法:
mkdir -p /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
 
然后:
systemctl daemon-reload
systemctl restart nginx.service
 
解决了问题。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31107.html