unicorn upstart script
josh.m.sharpe at gmail.com
Sun Aug 11 19:38:09 UTC 2013
I like the unicorn_forever idea, but as it's lightly tested, I
continued down the path of trying to hack upstart into compliance and
came up with this... Might as well share.
This works nicely when USR2 is received, and restarts the master if
for whatever reason it dies.
$ cat /etc/init/unicorn.conf
description "Unicorn configuration"
start on filesystem
stop on shutdown
kill signal QUIT
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
while [ $exists -eq 0 ]
(test -f $pidfile && pgrep -P $(cat $pidfile)) || (test -f
$oldpidfile && pgrep -P $(cat $oldpidfile))
exec rm /tmp/unicorn.master.pid
exec rm /tmp/unicorn.master.pid.oldbin
On Sat, Aug 10, 2013 at 2:20 AM, Hleb Valoshka <375gnu at gmail.com> wrote:
> On 8/10/13, Josh Sharpe <josh.m.sharpe at gmail.com> wrote:
>> I'm thinking a a wrapper script maybe required that stays running even
>> in the event of USR2 to being sent to unicorn, and only dies if the
>> process identified in the PID file is missing.
> Unicorn mailing list - mongrel-unicorn at rubyforge.org
> Do not quote signatures (like this one) or top post when replying
More information about the mongrel-unicorn