【问题标题】:New to supervisor - how to make a daemon that works新的主管 - 如何制作一个有效的守护进程
【发布时间】:2012-05-15 16:16:50
【问题描述】:

我是新来的主管。下面是我的主管配置文件。

# -*- conf -*-
[include]
files = *.supervisor

[supervisord]
pidfile = /var/run/supervisord.pid

[supervisorctl]
serverurl = unix://supervisord.sock

[unix_http_server]
file = /var/run/supervisord.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface


[program:main]
process_name = main-%(process_num)s
command = /usr/bin/python /home/ubuntu/workspace/rtbopsConfig/rtbServers/rtbTornadoServer/tornadoServer.py --tport %(process_num)s
--port=%(process_num)s
--log_file_prefix=%(here)s/logs/%(program_name)s-%(process_num)s.log
numprocs = 4
numprocs_start = 8050

现在,我需要妖魔化以下过程: 1)我可以停止父进程和所有孩子 2) 开始 3)重新加载所有子进程 4)如果一个孩子失败了,然后自动重新启动。
5) 这里是启动的命令行

supervisord -c /home/ubuntu/workspace/rtbopsConfig/rtb_supervisor/tornadoSupervisor.conf

那么...我使用 runit 吗?暴发户?

到目前为止,我已经杀死了 -9 所有的父母和孩子,如果我这样做了,他们不会重生。

【问题讨论】:

    标签: python ubuntu supervisord


    【解决方案1】:

    看看supervisorctl,它允许你启动/重启/自动启动/停止进程。如果这不符合您的需求,您还可以通过 XML-RPC 与supervisor 进行通信。

    【讨论】:

    • 我没有理解 supervisorctl。例如。如何使用 supervisorctl 停止使用 stop all?
    • 来自文档supervisorctl stop all
    猜你喜欢
    • 2011-07-20
    • 2014-07-25
    • 2023-03-02
    • 1970-01-01
    • 2021-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多