zoukankan      html  css  js  c++  java
  • 重启nginx后丢失nginx.pid,如何重新启动nginx

    在使用的阿里云服务器上,进程性的 nginx -s stop后再次启动nginx -s reload ,总是会报错误nginx: [error] open() "/alidata/server/nginx/logs/nginx.pid" failed (2: No such file or directory),这应该是因为把nginx进程杀死后pid丢失了,下一次再开启nginx -s reload时无法启动,重装可以解决这个问题,但是太麻烦了。

    一开始百度解决该问题。只是找到几个求助答案。没有实际有效的方法,于是用google开始搜索,虽然英语比较恶心,但一般,英文网站上总会有解决方法这一次也不另外。


     issued a nginx -s stop and after that I got this error when trying to reload it.

    [error]: invalid PID number "" in "/var/run/nginx.pid"

    That /var/run/nginx/pid file is empty atm.

    What do I need to do to fix it?


    nginx -s reload is only used to tell a running nginx process to reload its config. After a stop, you don't have a running nginx process to send a signal to. Just run nginx (possibly with a -c /path/to/config/file)

    于是我用了这方法,也就是nginx -c /path/to/config/file)  //在我机器上是这样的/alidata/server/nginx/sbin/nginx -c /alidata/server/nginx/conf/nginx.conf



    希望可以帮助到大家,还有就是搞计算机真他妈应该学好英语啊。

    最终解决方案:

    ```java sudo nginx -c /etc/nginx/nginx.con ```
  • 相关阅读:
    BZOJ2298: [HAOI2011]problem a
    BZOJ4066: 简单题
    BZOJ2131: 免费的馅饼
    Educational Codeforces Round 97 div2
    [SCOI2016]背单词
    [SCOI2015]情报传递(离线树状数组跑图)
    树上主席树(无代码,单纯谈思路的一篇水文)
    CF Round #679 div2赛后总结
    [SCOI2015]小凸解密码(平衡树、线段树做法)
    CF Round #677 div3 赛后总结
  • 原文地址:https://www.cnblogs.com/jpfss/p/10092669.html
Copyright © 2011-2022 走看看