nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument解决
先附上错误信息:
(myblog) root@Dapeng:/home/uwsgi# service nginx status
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Thu -- :: CST; 29s ago
Process: ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/ --pidfile /run/nginx.pid (code=exited, status=/SUCCESS)
Process: ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=/SUCCESS)
Process: ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=/SUCCESS)
Main PID: (nginx)
Tasks:
Memory: 1.8M
CPU: 35ms
CGroup: /system.slice/nginx.service
├─ nginx: master process /usr/sbin/nginx -g daemon on; master_process on
└─ nginx: worker process May :: Dapeng systemd[]: Stopped A high performance web server and a reverse proxy server.
May :: Dapeng systemd[]: Starting A high performance web server and a reverse proxy server...
May :: Dapeng systemd[]: nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
May :: Dapeng systemd[]: Started A high performance web server and a reverse proxy server.
我的操作系统是ubuntu16.04,今天突然重启nginx后,发现给我报了一个502的错误,看了一下nginx的状态,里面有一个错误提示,就如同标题那样,遂Google,在一个歪果仁的个人博客中看到一个链接,解决了我的问题,我这里只做一个搬运工,有问题的小伙伴也可以参考。再附上ubuntu社区参考链接:bug for ubuntu
这个问题被当做bug来解决了,不过好在有大神解决,附上解决思路:
It seems to be a race between systemd and nginx. As if systemd was expecting the PID file to be populated before nginx had the time to create it. Workaround: mkdir /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
然后我们再重启一下就好了。
nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument解决的更多相关文章
- centos7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument 解决方法
笔者在centos7上,配置nginx代理服务后, systemctl status nginx.service 提示错误 Failed to read PID from file /run/ngin ...
- Nginx启动错误 Failed to read PID from file /run/nginx.pid 的处理方法
问题产生原因 因为 nginx 启动需要一点点时间,而 systemd 在 nginx 完成启动前就去读取 pid file 造成读取 pid 失败 解决方法 让 systemd 在执行 ExecSt ...
- Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式
Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式 作者:ch ...
- Failed to issue method call: Unit httpd.service failed to load: No such file or directory.
centos7修改httpd.service后运行systemctl restart httpd.service提示 Failed to issue method call: Unit httpd.s ...
- nginx提示Job for nginx.service failed because the control的问题
启动nginx时就报错!Job for nginx.service failed because the control process exited with error code. See &qu ...
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
CentOS7中执行 service iptables start/stop 会报错Failed to start iptables.service: Unit iptables.service fa ...
- nginx进行项目域名配置时提示Job for nginx.service failed
ps aux | grep nginx /bin/systemctl stop nginx.service /bin/systemctl start nginx.service /bin/system ...
- CentOS 7.x关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory问题解决
一直用CentOS 6.x,今天用CentOS7.3版本时,防火墙配置后执行service iptables start出现”Failed to restart iptables.service: U ...
- centos7 ngxin启动失败:Job for nginx.service failed(80端口被占用的解决办法)
问题描述:(flaskApi) [root@67 flaskDemo]# service nginx start Redirecting to /bin/systemctl start nginx.s ...
随机推荐
- 我的Android Studio配置
Android Studio固然好用,但是刚从Eclipse转移到Android Studio上难免有很多不便,现在集中整理一下AS与Eclipse的区别,使得AS更好用. 快捷键Keymap到Ecl ...
- 一个经典的PHP文件上传类
需求分析如下: (1)支持单个文件上传 (2)支持多个文件上传 (3)可以指定保存位置 可以设置上传文件允许的大小和类型 可以选择重命名和保留原名 <!-- 设计一个经典文件上传类 需求分析 ( ...
- Codeforces Round #365 (Div. 2) A
Description Mishka is a little polar bear. As known, little bears loves spending their free time pla ...
- LeetCode 179 Largest Number 把数组排成最大的数
Given a list of non negative integers, arrange them such that they form the largest number.For examp ...
- ubuntu查看系统版本和内核版本
查看系统版本: cat /etc/issue sudo lsb_release -a 查看内核版本: uname -r
- Java面向对象_常用类库api
StringBuffer 例: public class StringBufferDemo { /** * @param args */ public static void main(String[ ...
- 无需控件直接导出xls(csv)
/// <summary> /// 执行导出 /// </summary> /// <param name="ds">要导出的DataSet&l ...
- 检查python以及django是否安装配置成功
首先说明下,我使用pycharm作为开发的IDE,在第一次创建django项目的时候,会自动安装django包的.(网上也有很多单独安装的方法),环境变量配置成功后,就是用下面的方法检测安装成功与否. ...
- vue3.0学习笔记(一)
一.搭建工作环境环境 1.从node.js官网下载相应版本进行安装即可 https://nodejs.org/zh-cn/download/,安装完成后在命令行输入 node -v 如果可以查询到版 ...
- spring-boot整合shiro作权限认证
spring-shiro属于轻量级权限框架,即使spring-security更新换代,市场上大多数企业还是选择shiro 废话不多说 引入pom文件 <!--shiro集成spring--& ...