Clear nofity socket from containerd env

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 365401703d)
This commit is contained in:
Michael Crosby 2016-03-31 17:56:21 -07:00 committed by Tibor Vass
parent 4d7d1736bd
commit c5d179891f

View file

@ -10,6 +10,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"sync"
"syscall"
"time"
@ -351,11 +352,19 @@ func (r *remote) runContainerdDaemon() error {
}
logrus.Debugf("runContainerdDaemon: runtimeArgs: %s", args)
}
cmd := exec.Command(containerdBinary, args...)
// redirect containerd logs to docker logs
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
cmd.Env = nil
// clear the NOTIFY_SOCKET from the env when starting containerd
for _, e := range os.Environ() {
if !strings.HasPrefix(e, "NOTIFY_SOCKET") {
cmd.Env = append(cmd.Env, e)
}
}
if err := cmd.Start(); err != nil {
return err
}