reopen logs on usr1

This commit is contained in:
Sam 2014-08-25 10:48:48 +10:00
parent 56a0a40175
commit de7888cd97
1 changed files with 8 additions and 0 deletions

View File

@ -23,10 +23,18 @@ function on_reload()
UNICORN_PID=$NEW_UNICORN_PID UNICORN_PID=$NEW_UNICORN_PID
} }
function on_reopenlogs()
{
echo "Reopening logs"
kill -s USR1 $UNICORN_PID
}
export UNICORN_SUPERVISOR_PID=$$ export UNICORN_SUPERVISOR_PID=$$
trap on_exit EXIT trap on_exit EXIT
trap on_reload USR2 HUP trap on_reload USR2 HUP
trap on_reopenlogs USR1
unicorn $@ & unicorn $@ &
UNICORN_PID=$! UNICORN_PID=$!