How to monitor delayed_job with monit

后端 未结 13 809
醉酒成梦
醉酒成梦 2020-12-02 04:11

Are there any examples on the web of how to monitor delayed_job with Monit?

Everything I can find uses God, but I refuse to use God since long running processes in

13条回答
  •  温柔的废话
    2020-12-02 04:24

    Thanks for the script.

    One gotcha -- since monit by definition has a 'spartan path' of

    /bin:/usr/bin:/sbin:/usr/sbin
    

    ... and for me ruby was installed / linked in /usr/local/bin, I had to thrash around for hours trying to figure out why monit was silently failing when trying to restart delayed_job (even with -v for monit verbose mode).

    In the end I had to do this:

    check process delayed_job with pidfile /var/www/app/shared/pids/delayed_job.pid
    start program = "/usr/bin/env PATH=$PATH:/usr/local/bin /var/www/app/current/script/delayed_job -e production start"
    stop program = "/usr/bin/env PATH=$PATH:/usr/local/bin /var/www/app/current/script/delayed_job -e production stop"
    

提交回复
热议问题