Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker container does not react on SIGTERM properly #32

Closed
RuralYak opened this issue Sep 13, 2019 · 1 comment
Closed

Docker container does not react on SIGTERM properly #32

RuralYak opened this issue Sep 13, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@RuralYak
Copy link
Contributor

Hello there,

Current implementation stuck on stop/kill command and does not pass sigterm signal to running instances of memcache and apache. This results in termination on timeout after 10 seconds. Proper reaction would be passing sigterm to downstream processes:

stop_apache()
{
  kill $(cat $apache_pidfile)
  rm -f $apache_pidfile
}

trap stop_apache INT TERM

apache &
echo $! > $apache_pidfile

wait $apache_pidfile
trap - TERM INT
wait $apache_pidfile
# run  server
CMD ["/bin/bash", "start.sh"]

This should result in much more quicker turnover of docker container.

Thank you.

@bilde2910 bilde2910 added the bug Something isn't working label Sep 14, 2019
@bilde2910
Copy link
Owner

I did note that it took a while to stop the Hauk container, and it didn't always come back up cleanly. I didn't figure out how to properly handle shutdown, but your PR did fix this issue. Thanks a lot for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants