Last active
August 29, 2015 14:13
-
-
Save jacoelho/a234644b14a4cd072d53 to your computer and use it in GitHub Desktop.
Upstart rvm sidekiq
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 "Sidekiq Background Worker" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
setuid ubuntu | |
setgid ubuntu | |
env HOME=/home/ubuntu/ | |
# This indicate that we want to restart the Job if it crashes | |
respawn | |
respawn limit 3 30 | |
# TERM is sent by sidekiqctl when stopping sidekiq. Without declaring these as normal exit codes, it just respawns. | |
normal exit 0 TERM | |
script | |
exec /bin/bash <<EOT | |
source $HOME/.rvm/scripts/rvm; | |
export GITHUB_TOKEN=<TOKEN> | |
export RAILS_ENV=<env> | |
cd $HOME/public_html/app/current | |
nohup bundle exec sidekiq -C config/sidekiq.yml >> log/sidekiq.log 2>&1 | |
EOT | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment