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

[root@data01 sbin]# ./nginx -s reload
nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"

 

查看nginx.pid为空

[root@data01 sbin]# cat /usr/local/nginx/logs/nginx.pid

解决:

查看nginx运行的PID,然后加入到nginx.pid文件中

root@data01 sbin]# ps -ef |grep nginx
root       6015      1  0 Jan17 ?        00:00:00 nginx: master process ./sbin/nginx
root      50668   6015  0 Feb01 ?        04:33:36 nginx: worker process
root      50669   6015  0 Feb01 ?        04:42:32 nginx: worker process
root      50670   6015  0 Feb01 ?        04:41:05 nginx: worker process
root      50671   6015  0 Feb01 ?        04:32:57 nginx: worker process
root      50672   6015  0 Feb01 ?        04:36:38 nginx: worker process
root      50673   6015  0 Feb01 ?        04:35:04 nginx: worker process
root      50674   6015  0 Feb01 ?        04:33:01 nginx: worker process
root      50675   6015  0 Feb01 ?        04:43:13 nginx: worker process
root      50676   6015  0 Feb01 ?        04:33:02 nginx: worker process
root      50677   6015  0 Feb01 ?        04:32:44 nginx: worker process
root      50678   6015  0 Feb01 ?        04:40:56 nginx: worker process
root      50679   6015  0 Feb01 ?        04:33:26 nginx: worker process
root      50680   6015  0 Feb01 ?        04:40:43 nginx: worker process
root      50681   6015  0 Feb01 ?        04:31:06 nginx: worker process
root      50682   6015  0 Feb01 ?        04:36:44 nginx: worker process
root      50683   6015  0 Feb01 ?        04:32:21 nginx: worker process
root      50684   6015  0 Feb01 ?        04:39:34 nginx: worker process
root      50685   6015  0 Feb01 ?        04:31:09 nginx: worker process
root      50686   6015  0 Feb01 ?        04:39:19 nginx: worker process
root      50687   6015  0 Feb01 ?        04:29:11 nginx: worker process
[root@data01 sbin]# echo 6015 > /usr/local/nginx/logs/nginx.pid
[root@data01 sbin]# ./nginx -s reload

 

转载于:https://www.cnblogs.com/xiaoyou2018/p/10762203.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值