How to monitor delayed_job with monit

后端 未结 13 821
醉酒成梦
醉酒成梦 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条回答
  •  萌比男神i
    2020-12-02 04:21

    Since i didn't want to run as root, I ended up creating a bash init script that monit used for starting and stopping (PROGNAME would be the absolute path to script/delayed_job):

    start() {
        echo "Starting $PROGNAME"
        sudo -u $USER /usr/bin/env HOME=$HOME RAILS_ENV=$RAILS_ENV $PROGNAME start
    }
    
    stop() {
        echo "Stopping $PROGNAME"
        sudo -u $USER /usr/bin/env HOME=$HOME RAILS_ENV=$RAILS_ENV $PROGNAME stop
    }
    

提交回复
热议问题