我使用monit监视几个自定义rails守护进程。他们在覆盆子pi上缓慢启动(毫不奇怪)。但monit summary命令在waiting
和execution failed
之间无休止地交替,即使日志显示守护进程正在运行,警报电子邮件也是如此。守护进程不会不断重启。
我的monit配置文件看起来像
check process setpoint_manager with pidfile /opt/thermyos.com/server/current/tmp/pids/setpoint_manager.pid every 2 cycles
start program = "/etc/init.d/setpoint_manager start" as uid thermyos and gid thermyos
stop program = "/etc/init.d/setpoint_manager stop"
if 5 restarts within 5 cycles then timeout
monit守护程序循环时间为60秒。日志文件显示
[EDT Aug 30 17:38:35] info : 'setpoint_manager' process is running with pid 2984
monit电子邮件说
Exists Service setpoint_manager
Date: Fri, 30 Aug 2013 17:38:35
Action: alert
Host: thermdev
Description: process is running with pid 2984
我已验证pid文件与ps ax
匹配。如果我通过monit重启守护进程,则状态变为正确。
为什么monit状态不能自我纠正?
答案 0 :(得分:1)
我联系了M / Monit的优秀支持人员,他们解释说这是monit 5.4中已知的错误,已在5.5中修复。自2013-07-26-wheezy-raspbian发布apt-get仅提供5.4后,我下载并构建了monit 5.6,一切都很棒。问题解决了。
为了在不加载更多内容的情况下构建Raspberry Pi并保持相同的配置,我使用了以下配置行:
./configure --without-pam --sysconfdir=/etc/monit