On Tue, 8 Nov 2016 11:20:45 +0200 Christos Trochalakis <yati...@ideopolis.gr> wrote: > On Fri, Apr 15, 2016 at 06:54:55PM +0200, Laurent Bigonville wrote: > >Package: nginx > >Version: 1.6.2-3 > >Severity: normal > >User: pkg-systemd-maintain...@lists.alioth.debian.org > > > >Hi, > > > >Wouldn't it be better to use KillSignal=SIGQUIT in the .service file > >rather than using this hack? > > > >ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile > >/run/nginx.pid > > > >Is it necessary really necessary to send QUIT, then TERM and then KILL? > > > > By using KillSignal=SIGQUIT systemd would forcibly (SIGKILL) nginx after > the timeout is reached. > > SIGQUIT triggers graceful shutdown so it waits for all existing client > connections to terminate. If for example you have websocket or SSE long > running clients you will hit the timeout. In such cases we don't want > systemd to SIGKILL nginx. > > The current solution fallbacks to SIGTERM that forces systemd to close > existing clients and terminate. > >
Would ExecStop=/bin/kill -QUIT $MAINPID work? This would first send SIQUIT to the main process, after TimeoutStopSec= it would send SIGTERM to all remaining processes and after another TimeoutStopSec=, SIGKILL. Is this the behaviour you want? It feels a bit more systemdish to me then involving start-stop-daemon -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature