Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created March 6, 2012 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonroelofs/1988020 to your computer and use it in GitHub Desktop.
Save jasonroelofs/1988020 to your computer and use it in GitHub Desktop.
Configure Upstart for Resque
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