Created
November 25, 2013 07:05
-
-
Save zacksiri/7637411 to your computer and use it in GitHub Desktop.
upstart script for unicorn app server
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
#/etc/init/change_this_to_your_app_name.conf | |
description "App Name" | |
author "Admin Name <[email protected]>" | |
start on virtual-filesystems | |
stop on runlevel [06] | |
env PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin | |
env RAILS_ENV=staging # what environment | |
env RACK_ENV=staging # what environment | |
setuid deployer # linux user | |
setgid admin # group | |
chdir /opt/apps/app_name | |
pre-start script | |
exec /usr/local/rbenv/shims/unicorn -D -c /opt/apps/app_name/config/unicorn.rb --env staging | |
end script | |
post-stop script | |
exec kill `cat /tmp/unicorn.app_name.pid` | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment