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
Please register or sign in to comment