Tags: monit rails servers

Monit restarting Mongrel Cluster - "Execution Failed"

Following in the footsteps of numerous other hapless people seeing this error - I had a frustrating number of hours, trying every combination of stuff that *should* work according to various recipes. The following is what I had to do to get monit playing nice with mongrel cluster (and thereby avoiding the lovely error "execution failed" when trying to get mongrel restarted via monit) This is on a CentOS 5 Enterprise x86_64 server. For some reason calling the cluster::start option on mongrel_rails would not work, I had to pass in all the flags manually to mongrel_rails, along with absolute paths for everything. But hey it works ... you can manually kill a mongrel process and watch monit bring it back up for you, right as rain !!! (note next step I'd change the monitrc to actually test a response from the mongrel server in question, rather than rely on the pid file) Setup: - mongrel user, in mongrel group. - mongrel owns /var/www/apps/myappname/ - monit is run as root user - mongrel user doesn't have sudo privileges in /etc/monitrc check process mongrel_8000 with pidfile /var/www/apps/myappname/shared/pids/mongrel.8000.pid start program = "/usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -c /var/www/apps/myappname/current/ --user mongrel --group mongrel -p 8000 -P /var/www/apps/myappname/shared/pids/mongrel.8000.pid -l /var/www/apps/myappname/shared/log/mongrel.8000.log" [stop program, rules etc following] [Rinse and repeat for each mongrel you're running in the cluster] Note that this will not work... start program = "/usr/local/bin/mongrel_rails cluster::start -C /var/www/apps/myappname/current/config/mongrel_cluster.yml --clean --only 8000"
blog comments powered by Disqus
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.