From ec78305c490e6e5f70f812b2af170525db8460f8 Mon Sep 17 00:00:00 2001 From: Shukui Yang Date: Mon, 13 May 2019 21:47:53 +0800 Subject: [PATCH] Close the inherited socket fd containerd-shim has dup the fd 3, and it don't need fd 3 any more. Signed-off-by: Shukui Yang --- cmd/containerd-shim/main_unix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/containerd-shim/main_unix.go b/cmd/containerd-shim/main_unix.go index 32dcbd737..cf1875eb9 100644 --- a/cmd/containerd-shim/main_unix.go +++ b/cmd/containerd-shim/main_unix.go @@ -196,7 +196,9 @@ func serve(ctx context.Context, server *ttrpc.Server, path string) error { err error ) if path == "" { - l, err = net.FileListener(os.NewFile(3, "socket")) + f := os.NewFile(3, "socket") + l, err = net.FileListener(f) + f.Close() path = "[inherited from parent]" } else { if len(path) > 106 {