Created
March 22, 2011 19:31
-
-
Save guilherme/881873 to your computer and use it in GitHub Desktop.
monit configuration for resque web
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process resque-web with pidfile /var/www/app/shared/resque_web/resque_web.pid | |
group resque | |
start program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh start" as uid deploy gid deploy | |
stop program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh stop" as uid deploy and gid deploy | |
if failed host localhost port 5678 with timeout 10 seconds then restart | |
if 3 restarts within 5 cycles then timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export APP_ROOT=/var/www/app/current | |
export RESQUE_WEB_ROOT=/var/www/app/shared/resque_web | |
export HOME=/home/deploy | |
export PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/bin | |
export PORT=5678 | |
if [[ -z $RAILS_ENV ]] | |
then | |
echo "SETTING RAILS_ENV AS development" | |
RAILS_ENV=development | |
fi | |
case $1 in | |
start) | |
/usr/bin/ruby /usr/bin/resque-web --app-dir $RESQUE_WEB_ROOT -e $RAILS_ENV $APP_ROOT/config/initializers/resque.rb -p $PORT | |
;; | |
stop) | |
/usr/bin/ruby /usr/bin/resque-web --app-dir $RESQUE_WEB_ROOT -e $RAILS_ENV $APP_ROOT/config/initializers/resque.rb -p $PORT -K | |
;; | |
*) | |
echo "usage: RAILS_ENV=environment run_resque_web.sh {start|stop}" ;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment