[packages/nginx] Fail faster if initial killproc fails

arekm arekm at pld-linux.org
Wed Jun 24 14:28:14 CEST 2026


commit c7b030abb426bea9f098331098046904d80e072f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Jun 19 20:33:23 2026 +0200

    Fail faster if initial killproc fails

 nginx.init | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/nginx.init b/nginx.init
index 64a9670..3784925 100755
--- a/nginx.init
+++ b/nginx.init
@@ -140,8 +140,11 @@ upgrade() {
 	killproc -p $pidfile $prog -USR2
 	RETVAL=$?
 
-	# wait for 3m
-	retry=720
+	# only wait for the new master if USR2 was delivered; otherwise the .oldbin
+	# pid file can never appear, so skip the 3m wait and fall through to the
+	# failure message below.
+	retry=0
+	[ $RETVAL -eq 0 ] && retry=720
 	while [ $retry -gt 0 ]; do
 		if [ -f $oldbin_pidfile ] && [ -f $pidfile ]; then
                         show "Upgrade: stopping old workers"
@@ -172,6 +175,7 @@ reopen_logs() {
 
 	show "Reopening $svname logs"
 	killproc -p $pidfile $prog -USR1
+	RETVAL=$?
 }
 
 RETVAL=0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nginx.git/commitdiff/d62ea5c24570989b5035a2a5dc2694dfc34ffe85



More information about the pld-cvs-commit mailing list