![自动重启不适用于监督程序](https://linux22.com/image/216517/%E8%87%AA%E5%8A%A8%E9%87%8D%E5%90%AF%E4%B8%8D%E9%80%82%E7%94%A8%E4%BA%8E%E7%9B%91%E7%9D%A3%E7%A8%8B%E5%BA%8F.png)
我正在使用supervisord,并且在supervisord程序自动重启方面遇到问题。
supervisord.conf
[supervisord]
logfile=/dev/null
pidfile=/tmp/supervisord.pid
nodaemon=true
[unix_http_server]
file = /tmp/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:worker]
command=./manage.py rq worker %(ENV_QUEUES)s
process_name=%(program_name)s-%(process_num)s
numprocs=%(ENV_WORKERS_COUNT)s
directory=/app
stopsignal=TERM
autostart=true
autorestart=true
startsecs=300
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[eventlistener:worker_healthcheck]
autorestart=true
serverurl=AUTO
command=./manage.py rq healthcheck
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
events=TICK_60
主管状态
abc@abc-adhocworker-c89d9667b-9lqbd:/app$ exec supervisorctl -c worker.conf status
worker:worker-0 FATAL Exited too quickly (process log may have details)
worker:worker-1 FATAL Exited too quickly (process log may have details)
worker_healthcheck RUNNING pid 14, uptime 7:43:34
状态显示它们处于致命状态,但即使我已配置也不会自动恢复autorestart=true
。
我还需要什么来确保程序在出现错误时自动恢复/重新启动?
重新启动是否有可能依赖于健康检查eventlistener
,并且可能会发送错误信号,即一切都很好,因此自动重新启动不适用于程序?
我的supervisord.conf 没有supervisorctl 部分,因此不确定是否添加了它,然后它可以正确触发自动重新启动,因为如果没有,supervisorctl status
supervisord 程序可能会失败?