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: ...
随机推荐
- Java-JDK-windows和linux版-百度云下载
链接: https://pan.baidu.com/s/15vjk4PNzuItd5vHJ6deq3Q 关注以下公众号,回复[9757],获取提取码 linux:jdk-8u221-linux-x64 ...
- python 异常和弹出框
import tkinter.messagebox try: fileContent = open("abnormal.txt") fileContent.close() prin ...
- VUE中让由全局变量添加生成的新数组不随全局变量的变化而变化
问题场景: const addOptions = { singleOrComplex, totalNum: this.smallTotalPrice, selectList: this.purchas ...
- BFC是什么?有什么作用?
BFC(Block Formatting Context)直译为“块级格式化范围”. 一.常见定位方案 在讲 BFC 之前,我们先来了解一下常见的定位方案,定位方案是控制元素的布局,有三种常见方案: ...
- Android studio 自动导入(全部)包 import (转)
原文: https://blog.csdn.net/buaaroid/article/details/44979629 1. Android studio 只有import单个包的快捷键:A ...
- 解决 Elasticsearch 超过 10000 条无法查询的问题
解决 Elasticsearch 超过 10000 条无法查询的问题 问题描述 分页查询场景,当查询记录数超过 10000 条时,会报错. 使用 Kibana 的 Dev Tools 工具查询 从第 ...
- Maven打包时出现无法下载org.apache.maven.plugins插件
解决方式: 方式1:使用 mvn clean package -U 打包即可(注意:出于性能原因,Maven缓存插件无法下载的信息.根据您的设置,您可能需要通过将标志添加-U到命令行来清除此缓存,以使 ...
- office web apps安装部署,配置https,负载均衡(二)域控制器安装并配置域账号
域控制器对服务器的要求不高,我们这里以windows server 2008R2为例 系统要求:windows server 2008R2 笔者也尝试使用了windows server 2012R2, ...
- IntelliJ IDEA 2018 for Mac专业使用技巧
IntelliJ IDEA 2018 for Mac是一个综合性的Java编程环境,被许多开发人员和行业专家誉为市场上最好的IDE,它提供了一系列最实用的的工具组合:智能编码辅助和自动控制,支持J2E ...
- 40G传输技术浅析
采用40G传输技术给运营商带来的好处 - 同样的带宽,更低的硬件成本.由于目前的光电器件工艺已臻于成熟,质量更为可靠,使40G的商用具有了必要的前提.同样是40G容量,器件的数量大致只有4个10G光接 ...