V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2014-12-23 00:44:03 +08:00 · 2929 次点击
    这是一个创建于 3420 天前的主题,其中的信息可能已经有所发展或是发生改变。




    这是配置

    12 条回复    2015-01-09 16:15:09 +08:00
    cevincheung
        1
    cevincheung  
    OP
       2014-12-23 00:51:19 +08:00

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

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

    - -#多简单- -#
    geew
        4
    geew  
       2015-01-09 14:34:10 +08:00
    cevincheung
        5
    cevincheung  
    OP
       2015-01-09 14:36:12 +08:00
    @geew 生产环境反而要取消daemon?
    geew
        6
    geew  
       2015-01-09 15:18:42 +08:00
    @cevincheung 你要用supervisor来管理nginx的话 就要取消daemon 不然启不起来的 redis也是 文档里面有写的哦
    KDr2
        7
    KDr2  
       2015-01-09 15:22:50 +08:00
    nginx.conf 里 daemon off;
    supervisor 里 stopsignal = QUIT

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

    我记得 pg_ctl start 就不会 daemon 的吧,或者配置文件里也能配置?
    cevincheung
        11
    cevincheung  
    OP
       2015-01-09 15:35:45 +08:00
    @KDr2
    pg_ctl 调用 postgres 还是daemon
    KDr2
        12
    KDr2  
       2015-01-09 16:15:09 +08:00
    @cevincheung 确实,可以这样:

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

    不过 pgsql 异常退出的话, pid file 可能没被删除,所以再复杂点, 检测 logfile 的 close 之类的,然后就担心 logrotate...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2260 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:42 · PVG 13:42 · LAX 22:42 · JFK 01:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.