Last active
August 29, 2015 14:22
-
-
Save kugaevsky/8931951b5e919f504300 to your computer and use it in GitHub Desktop.
Capistrano templates for Unicorn and Sidekiq upstart scripts
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
#!upstart | |
description "Upstart Script for a Freefeed sidekiq process" | |
start on startup | |
stop on shutdown | |
respawn | |
setuid deploy | |
setgid deploy | |
chdir <%= "#{deploy_to}/current/" %> | |
script | |
/usr/local/rvm/wrappers/ruby-2.2.1@freefeed/bundle exec sidekiq -e <%= fetch(:stage) %> | |
flock -x 0 < <%= deploy_to %>/current/tmp/pids/sidekiq.pid.lock | |
end script | |
pre-stop script | |
exec /bin/bash <<EOT | |
exec kill -QUIT `cat <%= shared_path %>/tmp/pids/sidekiq.pid` | |
EOT | |
end script |
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
#!upstart | |
description "Upstart Script for a Freefeed unicorn process" | |
start on startup | |
stop on shutdown | |
respawn | |
setuid deploy | |
setgid deploy | |
reload signal USR2 | |
chdir <%= "#{deploy_to}/current/" %> | |
script | |
/usr/local/rvm/wrappers/ruby-2.2.1@freefeed/bundle exec unicorn -c ./config/unicorn.rb --env <%= fetch(:stage) %> | |
flock -x 0 < <%= fetch(:deploy_to) %>/current/tmp/pids/unicorn.pid.lock | |
end script | |
pre-stop script | |
exec /bin/bash <<EOT | |
exec kill -QUIT `cat <%= shared_path %>/tmp/pids/unicorn.pid` | |
EOT | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment