Browse code

dockerd-rootless.sh: use exec

Killing the shell script process does not kill the forked process.

This commit switches to `exec` so that the executed process can be
easily killed.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 34cc5c24d052facb802331b8703664e5dc0ea10c)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

Akihiro Suda authored on 2019/05/15 20:52:59
Showing 1 changed files
... ...
@@ -75,7 +75,7 @@ if [ -z $_DOCKERD_ROOTLESS_CHILD ]; then
75 75
 	#         namespace from being unexpectedly unmounted when `/etc/resolv.conf` is recreated on the host
76 76
 	#         (by either systemd-networkd or NetworkManager)
77 77
 	# * /run: copy-up is required so that we can create /run/docker (hardcoded for plugins) in our namespace
78
-	$rootlesskit \
78
+	exec $rootlesskit \
79 79
 		--net=$net --mtu=$mtu \
80 80
 		--disable-host-loopback --port-driver=builtin \
81 81
 		--copy-up=/etc --copy-up=/run \
... ...
@@ -86,5 +86,5 @@ else
86 86
 	# remove the symlinks for the existing files in the parent namespace if any,
87 87
 	# so that we can create our own files in our mount namespace.
88 88
 	rm -f /run/docker /run/xtables.lock
89
-	dockerd $@
89
+	exec dockerd $@
90 90
 fi