From 21a0fc30e81ae824ddca607f4fd46e85047c0a7d Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Mon, 13 Mar 2017 14:49:40 +0000 Subject: [PATCH] Run weaver without exec. This: 1. prevents from generating defunct (a.k.a. zombie) processes, and therefore fixes #2836; but also 2. reintroduces #2684/#2688 as shells do not forward signals and we are still running more than one process. A proper fix would leverage something like tini. See also: - github.com/krallin/tini - github.com/krallin/tini/issues/8 - github.com/docker-library/official-images#init Sample output: - during initialisation: ``` $ ps auxf [...] root 1380 0.4 1.9 879660 74660 ? Ssl Mar13 6:02 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18528 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 15482 0.0 0.0 200496 3364 ? Sl 15:04 0:00 \_ docker-containerd-shim 3d1f5eb6e090 root 15496 0.0 0.0 1524 996 ? Ss 15:04 0:00 | \_ /bin/sh /home/weave/launch.sh root 15780 0.0 0.0 1524 64 ? S 15:04 0:00 | \_ /bin/sh /home/weave/launch. root 15872 0.0 0.0 1772 1272 ? S 15:04 0:00 | | \_ /bin/sh /home/weave/wea root 15897 0.0 0.0 1772 324 ? S 15:04 0:00 | | \_ /bin/sh /home/weave root 15898 0.0 0.0 14656 2948 ? S 15:04 0:00 | | \_ curl -o /tmp/we root 15781 10.0 1.5 484556 60296 ? Sl 15:04 0:00 | \_ /home/weave/weaver --port=6 [...] ``` - after initialisation: ``` $ ps auxf [...] root 1380 0.4 1.9 879660 74660 ? Ssl Mar13 6:02 /usr/bin/docker daemon -H fd:// -H unix:/// root 1664 0.0 0.4 502116 18592 ? Ssl Mar13 0:06 \_ docker-containerd -l /var/run/docker/li root 15482 0.0 0.0 200496 3364 ? Sl 15:04 0:00 \_ docker-containerd-shim 3d1f5eb6e090 root 15496 0.0 0.0 1524 996 ? Ss 15:04 0:00 | \_ /bin/sh /home/weave/launch.sh root 15781 2.3 1.6 503064 64320 ? Sl 15:04 0:00 | \_ /home/weave/weaver --port=6[...] ``` --- prog/weave-kube/launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prog/weave-kube/launch.sh b/prog/weave-kube/launch.sh index e7f79331..1b851d49 100755 --- a/prog/weave-kube/launch.sh +++ b/prog/weave-kube/launch.sh @@ -117,7 +117,7 @@ post_start_actions() { post_start_actions & -exec /home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \ +/home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \ --http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR --docker-api='' --no-dns \ --ipalloc-range=$IPALLOC_RANGE $NICKNAME_ARG \ --ipalloc-init $IPALLOC_INIT \