From 09c978fc9b528c36d86f3a45e183e1f580104e6b Mon Sep 17 00:00:00 2001 From: Dave Webb Date: Fri, 13 May 2016 20:54:07 +1200 Subject: [PATCH] Attempt to prevent zombie processes when run under systemd When systemd restarts the transmission-openvpn container, it seems to leave zombie processes as below. $ ps uaxww | grep Z root 1872 0.0 0.0 0 0 ? Z 08:58 0:00 [transmission-da] The zombies do appear to be cleaned up by restarting docker itself, or by stopping the transmission-openvpn service. This is an attempt to prevent zombies being spawned via Yelp's dumb-init, which correctly handles the signals that PID1 gets. See: https://github.com/Yelp/dumb-init --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 88aa9f759..c3f44afd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN apt-get update \ && apt-get update \ && apt-get install -y transmission-cli transmission-common transmission-daemon \ && apt-get install -y openvpn curl rar unrar zip unzip \ + && curl -sLO https://github.com/Yelp/dumb-init/releases/download/v1.0.1/dumb-init_1.0.1_amd64.deb \ + && dpkg -i dumb-init_*.deb \ + && rm -rf dumb-init_*.deb \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ && curl -L https://github.com/jwilder/dockerize/releases/download/v0.0.2/dockerize-linux-amd64-v0.0.2.tar.gz | tar -C /usr/local/bin -xzv @@ -101,4 +104,4 @@ ENV OPENVPN_USERNAME=**None** \ # Expose port and run EXPOSE 9091 -CMD ["/etc/openvpn/start.sh"] +CMD ["dumb-init", "/etc/openvpn/start.sh"]