Skip to content

Instantly share code, notes, and snippets.

@danielnolan
Last active January 2, 2016 11:59
Show Gist options
  • Save danielnolan/8300201 to your computer and use it in GitHub Desktop.
Save danielnolan/8300201 to your computer and use it in GitHub Desktop.
Sidekiq Upstart
description "Sidekiq Background Worker"
start on filesystem
stop on runlevel [06]
respawn
respawn limit 3 30
# change to match your deployment user
setuid deploy
setgid deploy
script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<EOT
# use syslog for logging
exec &> /dev/kmsg
export HOME=/home/deploy
source /home/deploy/.bash_profile
cd /home/deploy/{site_name}/current
bin/sidekiq -e production -C config/sidekiq.yml -i 0 -P tmp/pids/sidekiq.pid
EOT
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment