From 7e277a5dbc553c45dfeda022b57d0e7c01945c28 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 8 Oct 2015 11:18:41 -0300 Subject: [PATCH] sleep until existe unicorn.pid.oldbin file --- script/production | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/production b/script/production index d41e01c..f43c3cc 100755 --- a/script/production +++ b/script/production @@ -40,7 +40,10 @@ app_server_stop() { app_server_restart() { # see unicorn_rails(1) and "Signal handling" in unicorn documentation kill -s USR2 $(cat tmp/pids/unicorn.pid) - sleep 5 + while [ ! -f tmp/pids/unicorn.pid.oldbin ] + do + sleep 1 + done kill -s QUIT $(cat tmp/pids/unicorn.pid.oldbin) } -- libgit2 0.21.2