# Failed to read pid from file run nginxpid invalid argument

Ubuntu 安装或编译 Nginx 后 status 中通常会出现 PID 的错误

创建 nginx 服务目录

mkdir /etc/systemd/system/nginx.service.d

填充内容

printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf

重载 systemctl

systemctl daemon-reload

重启 nginx

systemctl restart nginx

若未能解决可尝试禁用防火墙(CentOS 7)

systemctl disable firewalld

文章部分内容转载链接: