Skip to content

Instantly share code, notes, and snippets.

@rguggemos
Created July 1, 2011 17:13
Show Gist options
  • Save rguggemos/1058983 to your computer and use it in GitHub Desktop.
Save rguggemos/1058983 to your computer and use it in GitHub Desktop.
redis and resque example
#RESQUE
#the resque_queue_start.sh contains this script:
# cd /web/bmn/; nohup bundle exec rake environment resque:work RAILS_ENV=staging QUEUE=* VERBOSE=1 PIDFILE=/web/bmn/log/resque_queue.pid 2>&1
check process resque_queue with pidfile /var/run/resque_queue.pid
start program = "/bin/su - root -c '/etc/redis/resque_queue_start.sh'"
stop program = "/bin/sh -c 'cd /web/bmn-dev/ && kill -s QUIT `cat /var/run/resque_queue.pid` && rm -f /var/run/resque_queue.pid; exit 0;'"
depends on redis
#REDIS
check process redis with pidfile /var/run/redis.pid
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment