Last active
January 2, 2016 11:59
-
-
Save danielnolan/8300201 to your computer and use it in GitHub Desktop.
Sidekiq Upstart
This file contains 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 "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