Commit a4b5329a06728536338516aa5fbefc8039ebb3eb

Authored by Leandro Santos
1 parent 7e277a5d

expose unicorn restart time

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
script/production
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 2
3 set -e 3 set -e
4 4
  5 +TIMEOUT=60
  6 +
5 if [ -e /etc/default/noosfero ]; then 7 if [ -e /etc/default/noosfero ]; then
6 . /etc/default/noosfero 8 . /etc/default/noosfero
7 fi 9 fi
@@ -40,8 +42,10 @@ app_server_stop() { @@ -40,8 +42,10 @@ app_server_stop() {
40 app_server_restart() { 42 app_server_restart() {
41 # see unicorn_rails(1) and "Signal handling" in unicorn documentation 43 # see unicorn_rails(1) and "Signal handling" in unicorn documentation
42 kill -s USR2 $(cat tmp/pids/unicorn.pid) 44 kill -s USR2 $(cat tmp/pids/unicorn.pid)
43 - while [ ! -f tmp/pids/unicorn.pid.oldbin ] 45 + count=0
  46 + while [ ! -f tmp/pids/unicorn.pid.oldbin || $count > $TIMEOUT ]
44 do 47 do
  48 + echo "Waitting for $count"
45 sleep 1 49 sleep 1
46 done 50 done
47 kill -s QUIT $(cat tmp/pids/unicorn.pid.oldbin) 51 kill -s QUIT $(cat tmp/pids/unicorn.pid.oldbin)