Source: nginx Version: 1.2.1-2 Severity: normal Tags: patch When using start-stop-daemon --stop, the program will return immediately upon sending the kill signal to the found process(es). In a restart situation, the sleep 1 may not be long enough for the old nginx to fully let go of any bound ports/addresses, leading to a race condition. This same problem was present in the memcached init script for a while as well.
-- System Information: Debian Release: wheezy/sid APT prefers precise-security APT policy: (990, 'precise-security'), (900, 'precise-updates'), (500, 'precise'), (400, 'precise-proposed') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-26-generic (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/nginx-common.nginx.init' --- a/debian/nginx-common.nginx.init 2012-05-14 11:15:00 +0000 +++ b/debian/nginx-common.nginx.init 2012-07-22 00:46:14 +0000 @@ -52,6 +52,7 @@ stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --retry \ --exec $DAEMON || true echo "$NAME." ;; @@ -59,6 +60,7 @@ restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ + --retry \ /var/run/$NAME.pid --exec $DAEMON || true sleep 1 test_nginx_config

