[Pkg-nginx-maintainers] Bug#821111: nginx, unix sockets and graceful/fast stop policy
Maxim Nikulin
m.a.nikulin at gmail.com
Sat Mar 10 06:19:21 UTC 2018
On Sat, 16 Jul 2016 18:07:22 -0700 Michael Lustfield
<michael at lustfield.net> wrote:
> After looking at this patch, I see that it was resolved in a previous commit.
> Commit: caee1c2a8790f3f5ad1e8f277d0426189a43558f
Sorry, that commit does not fix the problem with non-removed unix
sockets and there is some confusion with patches attached to the bug report.
+ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5
--pidfile /run/nginx.pid
line causes graceful stop, survived sockets, and so failure to start
next time. If the intention is fast shutdown as suggested in [1] then
stop retry schedule should be TERM/5. STOP_SCHEDULE in
debian/nginx-common.nginx.init should be changed accordingly e.g. to
TERM/10/KILL/5. There should be no QUIT in both cases. Also there is
some mess in comments in the file debian/nginx-common.nginx.service and
in the changelog.Debian and the commit messages, nobody sends the namely
SIGSTOP signal.
Sorry, I do not provide patch due to I am a bit lazy to setup
environment and check that patched package will be successfully built.
I was considering an additional hook in init scripts for removing
sockets after graceful stop. There are might be rare cases when it is
desirable to wait till finishing of some long transaction so graceful
shutdown is preferable. Unfortunately I do not see an easy way to get
list of stale sockets from the init scripts.
[1] https://trac.nginx.org/nginx/ticket/753#comment:5
More information about the Pkg-nginx-maintainers
mailing list