如果服务失败几次,Monit 似乎会放弃重新启动服务,并取消对其进行监控。我在文档中找不到任何关于时间或原因的细节。
我的 Monit 配置将设置如下:
set daemon 10
set logfile /var/log/monit.log
set statefile /var/lib/monit/monit.state
set alert foo@example.com not { nonexist, action, instance }
include /etc/monit/conf.d/*
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的 Monit 规则集的示例:
check process myservice
with pidfile /var/run/myservice/myservice.pid
start program = "/home/myservice/current/start-myservice.sh"
as uid myservice and gid myservice
stop program = "/home/myservice/current/stop-myservice.sh"
as uid myservice and gid myservice
mode active
Run Code Online (Sandbox Code Playgroud)
在我的环境中,我希望它无限期地继续尝试轮询间隔。有没有办法将 monit 配置为从不停止监视服务,即使它没有成功启动?