Skip to content
Commit caee1c2a authored by Christos Trochalakis's avatar Christos Trochalakis
Browse files

Fix systemd graceful stopping issue

The ExecStop stop command sends a SIGSTOP signal to the master process
that triggers the graceful-stop sequence.

The bug was that, when ExecStop exits and the process is still running,
systemd thinks that the command failed and sends a SIGTERM (force
stop for nginx) to all the processes in the process group. The command
used exited immediately so the SIGSTOP was followed by a SIGTERM
effectively canceling the graceful stop sequence.

We now use start-stop-deamon as the ExecStop command that waits for
5 secs before exiting.

So, after this fix, the stop sequence becomes:
STOP/5  (=> master)
TERM/5  (=> master)
KILL    (=> process group)
parent c6a5177c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment