我必须monit监视一个进程,但它没有意识到它已关闭。我的监控配置是这样的:
check process xxx with pidfile /var/run/xxx.pid
group yyy
start program = "/etc/init.d/xxx start"
stop program = "/etc/init.d/xxx stop"
if failed host 127.0.0.1 port 9999 then restart
if 5 restarts within 5 cycles then timeout
Run Code Online (Sandbox Code Playgroud)
问题是即使我的进程崩溃了,PID 文件仍然存在。所以...PID 存在但本地主机中的端口 9999 应该失败。那么... monit 是否应该不重启这个过程?应该删除pid文件吗?不能做那种OR?
提前致谢,