Created
October 8, 2013 02:18
-
-
Save t2ynkmr/6878390 to your computer and use it in GitHub Desktop.
unicorn を 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 "myapp" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 5 60 | |
console log | |
setuid hoge | |
setgid hoge | |
env APP_HOME=/hoge/hoge | |
pre-start script | |
export PATH=/home/hoge/.rbenv/shims:$PATH | |
export RBENV_ROOT=/home/hoge/.rbenv | |
export RAILS_ENV=production | |
exec bundle exec unicorn_rails -c config/unicorn.rb -E $RAILS_ENV -D | |
end script | |
post-stop script | |
exec kill -s QUIT `cat $APP_HOME/tmp/pids/unicorn.pid` | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ただ、プロセスを initctl 経由せずに停止させた場合に、 status が runninng のまま残っちゃう問題が。。。