From 59ec65cd8cec942cee6cbf2b8327ec57eb5078f0 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 26 Jan 2018 13:40:32 -0500 Subject: [PATCH] Use proc/exe for reexec You don't need to resolve the symlink for the exec as long as the process is to keep running during execution. Signed-off-by: Michael Crosby --- daemon/oci_linux.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index 53dc276565..dbc26e8efe 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -862,14 +862,10 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) { for _, ns := range s.Linux.Namespaces { if ns.Type == "network" && ns.Path == "" && !c.Config.NetworkDisabled { - target, err := os.Readlink(filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe")) - if err != nil { - return nil, err - } - + target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe") s.Hooks = &specs.Hooks{ Prestart: []specs.Hook{{ - Path: target, // FIXME: cross-platform + Path: target, Args: []string{"libnetwork-setkey", c.ID, daemon.netController.ID()}, }}, }