0
基本上,monit在文件“product_id”准备就绪时启动进程“CAD”。我的配置如下:Monit等待文件启动进程?
check file product_id with path /etc/platform/product_id
if does not exist then alert
check process cad with pidfile /var/run/cad.pid
depends on product_id
start = "/bin/sh -c 'cd /home/root/cad/scripts;./run-cad.sh 2>&1 | logger -t CAD'" with timeout 120 seconds
stop = "/bin/sh -c 'cd /home/root/cad/scripts;./stop-cad.sh 2>&1 | logger -t CAD'"
我期待“monit”调用“开始”,直到文件可用。但它似乎重启了每个周期的过程(停止和开始)。
这里有什么配置错吗?
感谢任何帮助。
为什么你使用“检查过程”块?查看文档,如果文件不存在于“检查文件”块中,您似乎可以执行脚本 https://mmonit.com/monit/documentation/monit.html#EXISTENCE-TESTING – alex9311