Created
December 19, 2015 03:40
-
-
Save phamonyut/8a3e96b7f3a0bd9675ab to your computer and use it in GitHub Desktop.
ตัวอย่าง upstart 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
#/etc/init/<your_app>.conf | |
description "Your App" | |
author "Phamon <[email protected]>" | |
start on virtual-filesystems | |
stop on runlevel [06] | |
env PATH=/opt/www/<your_app>/current/bin:/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin | |
env RAILS_ENV=production | |
env RACK_ENV=production | |
setuid deployer | |
setgid admin | |
chdir /opt/www/<your_app>/current | |
pre-start script | |
exec >/home/deployer/log/upstart-<your_app>.log 2>&1 | |
exec bundle exec unicorn -D -c /opt/www/<your_app>/current/config/unicorn.rb --env production | |
end script | |
post-stop script | |
exec kill `cat /opt/www/<your_app>/shared/tmp/pids/unicorn.<your_app>.pid` | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment