Your message dated Sat, 16 Jul 2016 18:07:22 -0700
with message-id <[email protected]>
and subject line 
has caused the Debian Bug report #821111,
regarding nginx: Failure to remove socket due to Debian's method of stopping
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
821111: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821111
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nginx
Version: 1.9.10-1
Severity: normal
Tags: patch

Hello,

It turns out that the way that Debian implements stopping nginx is by
sending it, through the start-stop-daemon's --retry option a SIGQUIT to
nginx, which is interpreted by nginx as a "gradeful shutdown", but it
turns out is not very clean way to shutdown, and nginx developers think
that nobody should be doing this[0]. The other stop method is the
SIGTERM, which is what they are expecting people to send to shutdown
nginx and it properly cleans up the sockets.


If you configure nginx to use a unix socket for a listener, then when
you restart, or stop and then start, nginx, it will fail to start
because it will not clean up the listening socket because it was stopped
with the 'SIGQUIT' method[1][2].

Additionally, in version 1.6.2-3 of the package upload this changelog
entry appears:

 * debian/nginx-common.nginx.init:                                              
                                                                              
    + Gracefully stop nginx by default, we are switcing to a configurable       
                                                                               
      STOP/5/TERM/5/KILL/5 schedule. We are now in sync with the systemd        
                                                                               
      service file. (Closes: #762708)

However, the initscript and the systemd service file are *not* in
sync. The systemd service file has just '--retry QUIT/5' and the
initscript has 'QUIT/5/TERM/5/KILL/5', so these are most definitely not
in sync.

I've attached patches that syncs these up, and has them do a SIGTERM
instead of a SIGQUIT because it appears to be more "graceful" and will
properly clean up sockets.

micah

0. https://trac.nginx.org/nginx/ticket/753#comment:5
1. https://trac.nginx.org/nginx/ticket/753 and
2. https://trac.nginx.org/nginx/ticket/952).

--- /tmp/nginx	2016-04-15 12:07:29.634756281 -0400
+++ /etc/init.d/nginx	2016-01-26 13:12:14.000000000 -0500
@@ -20,7 +20,7 @@
 	. /etc/default/nginx
 fi
 
-STOP_SCHEDULE="${STOP_SCHEDULE:-TERM/5/QUIT/5/KILL/5}"
+STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}"
 
 test -x $DAEMON || exit 0
 
--- /tmp/nginx.service	2016-04-15 12:07:12.135245311 -0400
+++ /lib/systemd/system/nginx.service	2016-01-26 13:12:14.000000000 -0500
@@ -20,7 +20,7 @@
 ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
 ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
 ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
-ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry TERM/5/QUIT/5/KILL/5 --pidfile /run/nginx.pid
+ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid
 TimeoutStopSec=5
 KillMode=mixed
 
-- System Information:
Debian Release: stretch/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
After looking at this patch, I see that it was resolved in a previous commit.
Commit: caee1c2a8790f3f5ad1e8f277d0426189a43558f

I'm marking this closed because the fix has been released.

-- 
Michael Lustfield

Attachment: pgpJOGT_08eHN.pgp
Description: OpenPGP digital signature


--- End Message ---

Reply via email to