瀏覽代碼

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>
Akihiro Suda 6 年之前
父節點
當前提交
34cc5c24d0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      contrib/dockerd-rootless.sh

+ 2 - 2
contrib/dockerd-rootless.sh

@@ -75,7 +75,7 @@ if [ -z $_DOCKERD_ROOTLESS_CHILD ]; then
 	#         namespace from being unexpectedly unmounted when `/etc/resolv.conf` is recreated on the host
 	#         (by either systemd-networkd or NetworkManager)
 	# * /run: copy-up is required so that we can create /run/docker (hardcoded for plugins) in our namespace
-	$rootlesskit \
+	exec $rootlesskit \
 		--net=$net --mtu=$mtu \
 		--disable-host-loopback --port-driver=builtin \
 		--copy-up=/etc --copy-up=/run \
@@ -86,5 +86,5 @@ else
 	# remove the symlinks for the existing files in the parent namespace if any,
 	# so that we can create our own files in our mount namespace.
 	rm -f /run/docker /run/xtables.lock
-	dockerd $@
+	exec dockerd $@
 fi