nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

   系统版本:CentOS 6.5 x86_64

    nginx版本:Nginx-1.6.1

今天在测试升级nginx版本到nginx-1.7.0的时候,有点小小的插曲,报错了nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid",在此记录以下加强记忆的同时,也避免以后再出现类似错误。

Step1. 升级完毕后,进行了重启(也可执行kill -QUIT 主进程号)

Step2. 进行相关测试,并/usr/local/nginx/sbin/nginx -s reload平滑重启后报错,见下图

#升级是成功的,但是服务没有启动。

Step3. 将主进程号添加到/usr/local/nginx/logs/nginx.pid文件后,居然报错nginx: [alert] kill(1176, 1) failed (3: No such process) 1176进程失败,没有此进程,看来被杀掉了

#此时看到进程已变为1196,说明之前的进程操作是无效的

Step4. 后来想想,应该是没有做启动服务操作,就执行了/usr/local/nginx/sbin/nginx,木有想到,果然是这个问题,大写的尴尬啊!!!

#此时可以看到,服务已成功启动,pid文件有相应的进程号,通过页面测试一切正常,升级宣告成功!

时间: 2024-10-05 05:41:47

nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"的相关文章

nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”

在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid" 解决办法: $ sudo nginx -c /usr/local/etc/nginx/nginx.conf $ sudo nginx -s reload

解决 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

使用/usr/local/nginx/sbin/nginx -s reload 重新读取配置文件出错 [[email protected] nginx]/usr/local/nginx/sbin/nginx -s reload提示 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid" [[email protected] nginx]# cd logs[[email pro

nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid"

进入nginx文件下,例如 :/usr/local/nginx/sbin [[email protected] /]# cd /usr/local/nginx/sbin 运行命令: [[email protected] /]# ./nginx -c /usr/local/webserver/nginx/conf/nginx.conf 重新加载: [[email protected] /]# ./nginx -s reload 原文地址:https://www.cnblogs.com/gyrgyr

nginx: [error] invalid PID number问题处理

再启动nginx服务时,无法正常启动,报错误信息如下nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid" 解决方法: /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 使用nginx -c的参数指定nginx.conf文件的位置然后再重新启动,解决问题,可以通过ps -ef|grep nginx

nginx: [error] invalid PID number

一.检查nginx配置文件语法有无错误 [[email protected] conf]# /application/nginx/sbin/nginx -tnginx: the configuration file /application/nginx-16.0/conf/nginx.conf syntax is ok nginx: configuration file /application/nginx-16.0/conf/nginx.conf test is successful 二.平滑

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 2017年09月14日 09:15:45 阅读数:7742 启动Nginx出现这个错误 nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 1  解决方法:找

nginx: [error] invalid PID number "" in "/run/ngin

nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决办法 需要先执行 nginx -c /etc/nginx/nginx.conf

解决:error: Cannot find libmysqlclient_r under /usr/local/mysql.

转 解决:error: Cannot find libmysqlclient_r under /usr/local/mysql. 配置php的时候出现以下问题解决方案 checking for MySQL support... yeschecking for specified location of the MySQL UNIX socket...nochecking for MySQL UNIX socket location... noconfigure: error: Cannot fi

mac 安装polymer cli Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build'

安装的时候根据说明,需要使用npm install -g polymer-cli命令,但是一直提示没有权限, 后来增加sudo后提示如下, Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build' at Object.fs.mkdirSync (fs.js:905:18) at sync (/usr/local/lib/node_modules/p