Closed bswinnerton closed 4 years ago
Hi,
It's not exactly Overmind bug. Overmind doesn't do anything fancy while interrupting processes, it just sends them SIGINT. When you hit ctrl +c, you send the signal directly to the process inside the container because your Stdin is attached to it. But when you send SIGINT
to docker run
process it just deattaches container and exits, don't know why. You can reproduce the same behavior without Overmind by sending SIGINT
to docker run
with kill -2
.
There is a workaround for this case, but it looks a bit hacky. Just add this to your script:
trap 'docker stop websockify' EXIT > /dev/null
Or you can add the same to the Procfile:
websockify: trap 'docker stop websockify' EXIT > /dev/null; script/websockify-server
Hi there!
I'm running into an issue where a
docker run
process, executed via a script, isn't properly killed by Overmind'sSIGINT
.My
Procfile
reads as follows:The
script/websockify-server
reads:When running
script/websockify-server
, I can properly kill it with ctrl +c:But when running
overmind start
and killing with a ctrl +c, the docker container is left running:At first I thought this may be related to docker running as PID 1 and needing a
--init
passed todocker run
to properly capture the signal, but it's curious that everything works fine when not using Overmind.The Dockerfile in question can be found here.