[DRE-commits] [SCM] unicorn.git branch, master, updated. upstream/4.2.1-19-g4e773b8

Hleb Valoshka 375GNU at Gmail.COM
Sun Apr 22 18:45:00 UTC 2012


The following commit has been merged in the master branch:
commit 18b6b108bb0aab0486eb56fc9a4af7d2893a337c
Author: Hleb Valoshka <375GNU at Gmail.COM>
Date:   Sun Apr 22 21:40:26 2012 +0300

    Fix postinst script
    
      * change incorrect OLD_PID variable name to OLDPID
      * some cosmetic changes

diff --git a/debian/unicorn.postinst b/debian/unicorn.postinst
index 423d5a5..f67655e 100644
--- a/debian/unicorn.postinst
+++ b/debian/unicorn.postinst
@@ -10,10 +10,9 @@ if [ -f /etc/default/unicorn ]; then
   . /etc/default/unicorn
 fi
 
-DAEMON=/usr/bin/unicorn
 TIMEOUT=${TIMEOUT-60}
 PID=${PID-/run/unicorn.pid}
-OLDPID="${PID}.oldbin"
+OLD_PID="${PID}.oldbin"
 
 invoke() {
   if [ -x /usr/sbin/invoke-rc.d ]; then
@@ -27,11 +26,11 @@ running() {
   invoke $1 status
 }
 
-sig () {
-  test -s "$PID" && kill -$1 `cat $PID`
+sig() {
+  test -s $PID && kill -$1 `cat $PID`
 }
 
-oldsig () {
+oldsig() {
   test -s $OLD_PID && kill -$1 `cat $OLD_PID`
 }
 
@@ -47,16 +46,16 @@ upgrade() {
       echo "$OLD_PID still exists after $TIMEOUT seconds. Killing and starting new."
       sig KILL || true
       oldsig KILL || true
-      invoke unicorn start
+      invoke unicorn start || exit $?
     fi
   fi
 }
 
 if [ -x /etc/init.d/unicorn ]; then
-    if ( running unicorn ) ; then
+    if running unicorn; then
       upgrade
     else
-      invoke unicorn start
+      invoke unicorn start || exit $?
     fi
 fi
 

-- 
unicorn.git



More information about the Pkg-ruby-extras-commits mailing list