]> git.pld-linux.org Git - packages/nginx.git/commitdiff
- rel 4; 1s before signaling oldbin to quit was not enough and what worse it never... auto/th/nginx-1.15.8-4
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 14 Feb 2019 10:17:03 +0000 (11:17 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 14 Feb 2019 10:17:03 +0000 (11:17 +0100)
nginx.init
nginx.spec

index f209fc06a855779ad8130418cf3ef5865dee7f77..1d62b97a8577ea655521e4496666881d7440489d 100755 (executable)
@@ -133,20 +133,29 @@ condrestart() {
 # http://nginx.org/en/docs/control.html#upgrade
 # TODO: handle revert back on failed upgrade
 upgrade() {
-       local oldbin_pidfile="${pidfile}.oldbin"
+       local oldbin_pidfile="${pidfile}.oldbin" retry
 
        checkconfig
        show "Upgrading $svname"
        killproc -p $pidfile $prog -USR2
        RETVAL=$?
-       sleep 1
-       if [ -f $oldbin_pidfile ] && [ -f $pidfile ]; then
-               show "Upgrade: stopping old process"
-               killproc -p $oldbin_pidfile $prog -QUIT
-               return 0
-       else
-               return 1
-       fi
+
+       # wait for 15s
+       retry=60
+       while [ $retry -gt 0 ]; do
+               if [ -f $oldbin_pidfile ] && [ -f $pidfile ]; then
+                       show "Upgrade: stopping old process"
+                       killproc -p $oldbin_pidfile $prog -QUIT
+                       return 0
+               else
+                       usleep 250000
+                       retry=$(($retry -1))
+               fi
+       done
+
+       show "Upgrade: stopping old process"; fail
+       nls 'old process pid file was not found'
+       return 1
 }
 
 # Tell nginx to reopen logs
index a43813c4303d420c25ed77d73136731dd37116c2..f1beea8b7a229e902b755fb70586b98f4e7c8d4c 100644 (file)
@@ -42,7 +42,7 @@ Summary(pl.UTF-8):    Serwer HTTP i odwrotne proxy o wysokiej wydajności
 # - mainline: production quality but API can change
 Name:          nginx
 Version:       1.15.8
-Release:       3
+Release:       4
 License:       BSD-like
 Group:         Networking/Daemons/HTTP
 Source0:       http://nginx.org/download/%{name}-%{version}.tar.gz
This page took 0.027747 seconds and 4 git commands to generate.