This only happens when the script is running inside a shell spawned by docker exec
. When running under bash or under docker run
, there is no defunct process.
This bug is first discovered when I run nvm in docker (creationix/nvm#650). It was then discovered that Docker's nsenter did not properly handle the SIGCHLD signal raised from zsh. (docker/libcontainer#369) Even though it is now been fixed by Docker, I am not sure why zsh would cause this bug in the first place.
Steps to reproduce:
# terminal 1