I have a docker container with apache running in foreground. On stopping the docker container , a SIGTERM is sent to all the child processes , which is apache in our case.
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 SIGWINCH , which would eventually gracefully shutdown the server.
I was thinking of writing some kind of wrapper script , but couldn't get as to how to start.
Any suggestions in this regard would be highly appreciated!
Thanks.