Nginx启动错误 Failed to read PID from file /run/nginx.pid 的处理方法
问题产生原因
因为 nginx 启动需要一点点时间,而 systemd 在 nginx 完成启动前就去读取 pid file
造成读取 pid 失败
解决方法
让 systemd 在执行 ExecStart 的指令后等待一点点时间即可
如果你的 nginx 启动需要时间更长,可以把 sleep 时间改长一点
建立目录
mkdir -p /etc/systemd/system/nginx.service.d
在新建目录中建立文件override.conf,输入内容
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
重启 daemon 和 Nginx
systemctl daemon-reload
systemctl reload nginx
Nginx启动错误 Failed to read PID from file /run/nginx.pid 的处理方法的更多相关文章
- 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.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 ...
- nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid"
问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/ngin ...
- nginx: [error] invalid PID number "" in "/run/nginx.pid"
在重启云主机(系统)之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/ ...
- Centos7.5中Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法
服务器重启之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "" ...
- [linux] 小问题:管道符,换行问题等;[nginx]启动,重启,关闭命令;以及升级nginx切换命令
Lniux换行问题 后面回车不会马上执行本条命令而是换行继续. : 是运行完前面就继续后面的, && 同样是前面正确就运行后面, || 是前面运行不正确就运行后面. | 管道符“|”将 ...
- nginx 启动错误
场景 在Windows下 启动nginx报错: nginx: [error] ReadFile() : Incorrect function) 解决 因为 nginx.conf 中存在 /* 被认为是 ...
- Nginx启动错误:error while loading shared libraries: libpcre.so.0
今天测试的时候,启动一个其他机器预编译好的nginx到目标测试机器(OEL 7.4)启动的时候,报了下列错误: /usr/local/nginx/sbin/nginx: error while loa ...
- Nginx启动错误:error while loading shared libraries: libpcre.so.1
1 # /usr/local/nginx/sbin/nginx 2 /usr/local/nginx/sbin/nginx: error while loading shared libraries: ...
随机推荐
- LeetCode---Sort && Segment Tree && Greedy
307. Range Sum Query - Mutable 思路:利用线段树,注意数据结构的设计以及建树过程利用线段树,注意数据结构的设计以及建树过程 public class NumArray { ...
- 微信公众号实现无限制推送模板消息!可向指定openID群发
微信认证的服务号才有推送模板消息接口所以本文需要在认证服务号的情况下学习 以上就是模板消息,只有文字和跳转链接,没有封面图.在服务号的后台添加功能插件-模板消息即可. 模板消息,都是在后台选择一个群发 ...
- 重入锁 ReentrantLock (转)(学习记录)
重入锁(ReentrantLock)是一种递归无阻塞的同步机制.以前一直认为它是synchronized的简单替代,而且实现机制也不相差太远.不过最近实践过程中发现它们之间还是有着天壤之别. 以下是官 ...
- mysql 存储过程中使用动态sql语句
Mysql 5.0 以后,支持了动态sql语句,我们可以通过传递不同的参数得到我们想要的值 这里介绍两种在存储过程中的动态sql: set sql = (预处理的sql语句,可以是用concat拼接的 ...
- 收集的21个优秀的学习资源Kotlin
一.教程 1.The Kotlin Website Kotlin 官方网站(英文) 2.Kotlin editor Kotlin 在线编辑器 3.Keddit:在开发Android应用程序时学习K ...
- Why convolutions always use odd-numbers as filter_size
原文地址:https://datascience.stackexchange.com/questions/23183/why-convolutions-always-use-odd-numbers-a ...
- np.array()与np.asarray()区别
1. 数据源a是数组ndarray时,array仍然会copy出一个副本,占用新的内存,但asarray不会.也就是说改变a的值,b不会. # 数据源a是列表时,两者没区别 a=[[1,2,3],[4 ...
- 详解nohup和& 区别
nohup 一.[解释] 不挂断地运行命令.no hangup的缩写,意即“不挂断”.一般理解&记住一个命令最简单的方法是记住它是什么缩写,就自然理解了这个命令.nohup运行由 Comman ...
- Vue路由的跳转方式
Vue中路由的跳转方式 一.<router-link to=''></router-link> Header.vue <template> <header&g ...
- 如何使用StarUML for Mac创建和修改元素
StarUML for Mac是一款UML软件建模器,支持快速编辑中的许多缩写,一次创建元素和关系,如子类,支持接口等.如何使用StarUML for Mac创建和修改元素?下面我们来介绍一下. 如何 ...