docker-meteor icon indicating copy to clipboard operation
docker-meteor copied to clipboard

Docker signal handling issue during development mode

Open DanielDent opened this issue 10 years ago • 1 comments

mfal noted: "Nice work! One thing: Stopping the meteor server (with CTR+C) leads to an infinite loop of server restarts. That's why I start the container in detached mode (-d and without --rm and -ti). Afterwards I use docker logs -f to see what's going on.

To shutdown or reload the container I use docker stop/restart ."

I responded: "Thanks for the feedback! I experienced the same frustration and I agree with you this is annoying. Your approach seems like a straightforward workaround. Using docker's kill command has been the workaround I've been using. I've been wanting to chat with the Docker folks about this. The signal handling doesn't feel quite right to me, I believe ctrl-c should be trapped and sent to the process, much how telnet & ssh behave. Docker's command line help indicates signal proxying is happening, but things are not behaving quite as I expect.".

My message to the docker mailing list has not yet received a response. This issue could use future follow-up.

DanielDent avatar Dec 19 '14 22:12 DanielDent

This seems to be because Docker does not currently provide init services within a container. Meteor in development mode launches processes such as MongoDB, and those processes need to be reaped. I will look at using an init service within the container in a future version.

Further reading:

  • http://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
  • http://phusion.github.io/baseimage-docker/
  • https://groups.google.com/forum/#!topic/docker-user/O77URg38dAg
  • https://github.com/docker/docker/issues/3793

DanielDent avatar Jan 31 '15 03:01 DanielDent