[Mongrel] Machine reboot - monit fails to start mongrels

Henry hpoydar at gmail.com
Thu Mar 29 10:50:53 EDT 2007

Greetings -

I dug around a bit and I couldn't find a definitive answer to this  
question, apologies if it's been covered before.   A box running a  
apache 2.2 -> mongrel cluster for a rails app got power cycled at my  
ISP.  Unfortunately monit couldn't start the mongrel processes  
because the pid files were still there. Here is my monit config (for  
each mongrel process):

check process myapp_mongrel_8000 with pidfile /data/wwwroot/myapp.com/ 
         start program = "/usr/bin/mongrel_rails start -d -e  
production -p 8000 -a -P log/mongrel.8000.pid -c /data/ 
wwwroot/myapp.com --user mongrel --group mongrel"
         stop program = "/usr/bin/mongrel_rails stop -P log/mongrel. 
8000.pid -c /data/wwwroot/myapp.com"
         if failed host port 8000 protocol http
                 and request "/" then alert
         if cpu is greater than 60% for 2 cycles then alert
         if cpu > 80% for 5 cycles then restart
         if loadavg(5min) greater than 10 for 8 cycles then restart
         if 3 restarts within 5 cycles then timeout

Is there some other command line switch I can add to avoid this  
problem?  Should I config monit to clear the .pid files first?


More information about the Mongrel-users mailing list