与exec代码的monit错误

时间:2014-10-16 07:57:20

标签: exec nohup monit

这是一个monit conf文件/etc/monit.d/file.conf

check process python
    matching "python"
    if failed
    exec "/usr/bin/nohup ./path to a.py 2>/dev/null &"
    exec "/usr/bin/killall -9 python"
    if uptime > 3 minutes then
我在第4行遇到语法错误:/etc/monit.d/python:4:错误:语法错误'exec'' 我做错了什么? 有人可以提出一个简单的方法吗?

2 个答案:

答案 0 :(得分:0)

then之后您错过了if failed

if failed then

答案 1 :(得分:0)

我不确定exec是否是正确的关键字。 以下是有关如何启动流程以及 monit 或其中的个人示例:

check process mako matching "mako.conf"
    start program = "/usr/bin/mako -d -c /home/pi/mako/mako.conf"
    stop program  = "/usr/bin/killall mako"
    if 5 restarts within 5 cycles then timeout

此致