Created
August 12, 2013 12:32
-
-
Save m3nd3s/6210443 to your computer and use it in GitHub Desktop.
Upstart Script for Unicorn
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 "Unicorn configuration" | |
start on filesystem | |
stop on shutdown | |
respawn | |
kill signal QUIT | |
script | |
start-stop-daemon --start --chuid blue --chdir | |
/u/apps/blue-test-app/current --exec /usr/bin/bundle exec | |
unicorn_rails -- -c /u/apps/blue-test-app/shared/system/unicorn.cfg -E | |
production | |
exists=0 | |
pidfile=/tmp/unicorn.master.pid | |
oldpidfile=/tmp/unicorn.master.pid.oldbin | |
while [ $exists -eq 0 ] | |
do | |
sleep 0.1 | |
(test -f $pidfile && pgrep -P $(cat $pidfile)) || (test -f | |
$oldpidfile && pgrep -P $(cat $oldpidfile)) | |
exists=$? | |
done | |
exec rm /tmp/unicorn.master.pid | |
exec rm /tmp/unicorn.master.pid.oldbin | |
exit 1 | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment