Created
March 6, 2012 18:31
-
-
Save jasonroelofs/1988020 to your computer and use it in GitHub Desktop.
Configure Upstart for Resque
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
description "Resque worker configuration. Run with ID" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
respawn | |
respawn limit 5 20 | |
instance $ID | |
script | |
PIDFILE=/path/to/pids/resque-$ID.pid | |
echo $$ > $PIDFILE | |
chown www-data:www-data $PIDFILE | |
exec su -c "cd /path/to/app/current && /usr/local/bin/ruby -S bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=$PIDFILE >> /path/to/logs/resque-$ID.log 2>&1" www-data | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment