Gracefully stop Phusion Passenger running on apache
<p>I have a docker container with apache running in <strong>foreground</strong>. On stopping the docker container , a SIGTERM is sent to all the child processes , which is apache in our case.</p>

<p>Now, the problem i am facing is to gracefully shutdown apache on receiving SIGTERM signal. 
Apache normally terminates on the current requests immediately which is the main cause of the problem . Somehow, i need to translate the SIGTERM signal to <strong>SIGWINCH</strong> , which would eventually gracefully shutdown the server.</p>

<p>I was thinking of writing some kind of wrapper script , but couldn't get as to how to start.</p>

<p>Any suggestions in this regard would be highly appreciated!</p>

<p>Thanks.</p>