推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
cevincheung
V2EX  ›  Python

supervisor 为啥状态监控显示不对?

  •  
  •   cevincheung ·
    cevin · Dec 23, 2014 · 3839 views
    This topic created in 4336 days ago, the information mentioned may be changed or developed.




    这是配置

    12 replies  •  2015-01-09 16:15:09 +08:00
    cevincheung
    cevincheung
    OP
    Dec 23, 2014
    1

    这样也不行
    hzqim
    hzqim
    Dec 23, 2014
    2
    /etc/init.d 下是否有nginx启动脚本?如果有,和supervisor是否冲突?把init.d下脚步的禁用看看。
    cevincheung
    cevincheung
    OP
    Dec 23, 2014
    3
    @hzqim 木有,nginx操作太简单没用脚本。直接ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx。

    nginx #启动
    nginx -s reload 重载配置

    - -#多简单- -#
    cevincheung
    cevincheung
    OP
    Jan 9, 2015
    5
    @geew 生产环境反而要取消daemon?
    geew
    geew
    Jan 9, 2015
    6
    @cevincheung 你要用supervisor来管理nginx的话 就要取消daemon 不然启不起来的 redis也是 文档里面有写的哦
    KDr2
    KDr2
    Jan 9, 2015
    7
    nginx.conf 里 daemon off;
    supervisor 里 stopsignal = QUIT

    supervisor负责把进程做成 daemon,自己 daemon 的话,supervisor 会认为它挂了。
    supervisor有些不好用的地方,比如配置了 numprocs 的项目,不知道怎么一次重启这 numprocs 个进程……
    cevincheung
    cevincheung
    OP
    Jan 9, 2015
    8
    @KDr2
    但凡是自己有daemon机制的都要取消。是这意思呗?
    那pgsql咋办
    geew
    geew
    Jan 9, 2015
    9
    @cevincheung 那就不用supervisor来管理就是了嘛 没必要全部的都用supervisor来管理 比如nginx 独立启动要更好些
    KDr2
    KDr2
    Jan 9, 2015
    10
    @cevincheung

    我记得 pg_ctl start 就不会 daemon 的吧,或者配置文件里也能配置?
    cevincheung
    cevincheung
    OP
    Jan 9, 2015
    11
    @KDr2
    pg_ctl 调用 postgres 还是daemon
    KDr2
    KDr2
    Jan 9, 2015
    12
    @cevincheung 确实,可以这样:

    pg_ctl -D ./data start
    inotifywait -e delete ./data/postmaster.pid

    不过 pgsql 异常退出的话, pid file 可能没被删除,所以再复杂点, 检测 logfile 的 close 之类的,然后就担心 logrotate...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3402 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:07 · PVG 08:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.