如何解决“进入FATAL状态,太多开始重试太快”的主pipe

我只是用简单的程序configuration来testing我的主pipe:

[program:test] command=python -c "print 'hello'" autostart=true autorestart=true exitcodes=1 user=ratdon stdout_logfile=/opt/log/test.log stderr_logfile=/opt/log/test.log 

sudo supervisord -n -c /opt/supervisord.conf &启动supervisord。 但是经过几次产卵后,它再次停止产卵。

 2016-02-01 11:17:58,973 CRIT Supervisor running as root (no user in config file) 2016-02-01 11:17:58,973 WARN Included extra file "/opt/test.ini" during parsing 2016-02-01 11:17:58,994 INFO RPC interface 'supervisor' initialized 2016-02-01 11:17:58,994 CRIT Server 'inet_http_server' running without any HTTP authentication checking 2016-02-01 11:17:58,995 INFO supervisord started with pid 19644 2016-02-01 11:17:59,998 INFO spawned: 'test' with pid 19648 2016-02-01 11:18:00,026 INFO exited: test (exit status 0; not expected) 2016-02-01 11:18:01,030 INFO spawned: 'test' with pid 19650 2016-02-01 11:18:01,064 INFO exited: test (exit status 0; not expected) 2016-02-01 11:18:03,072 INFO spawned: 'test' with pid 19653 2016-02-01 11:18:03,104 INFO exited: test (exit status 0; not expected) 2016-02-01 11:18:06,108 INFO spawned: 'test' with pid 19657 2016-02-01 11:18:06,138 INFO exited: test (exit status 0; not expected) 2016-02-01 11:18:07,139 INFO gave up: test entered FATAL state, too many start retries too quickly 

我想要主pipe继续重新启动程序,直到我停止supervisord。

可能吗? 如果是的话该怎么办?

有没有任何select,使主pipe日志stdout时间戳,或者我们需要把时间戳本身stdout

在Docker微服务环境中工作时遇到了相同的用例。 就我而言,Nginx在dynamic生成configuration之前就已经启动了。

目前无法让Supervisord无限的重启服务,直到成功启动。

但是,使用startretries选项有一个可行的解决方法。 使用startretries选项,Supervisord将重新启动给定的次数,或者直到过程成功启动。

在我的具体使用情况下,竞赛条件的时间不到一秒钟,所以设置startretries=2就足够了。 但是,如果需要,您可以将其设置为更高的值。

 [program:test] startretries=10 

实际上一个更好的办法是把优先权分配给已启动的项目

 [program:x] priority=1 [program:y] priority=2 

请注意,较低的数字表示较高的启动顺序,当然包括大量的重试次数