1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #21709 from crosbymichael/clear-notify-socket

Clear nofity socket from containerd env
This commit is contained in:
Michael Crosby 2016-04-01 11:15:05 -07:00
commit 8eb8a1d6b8

View file

@ -10,6 +10,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings"
"sync" "sync"
"syscall" "syscall"
"time" "time"
@ -351,11 +352,19 @@ func (r *remote) runContainerdDaemon() error {
} }
logrus.Debugf("runContainerdDaemon: runtimeArgs: %s", args) logrus.Debugf("runContainerdDaemon: runtimeArgs: %s", args)
} }
cmd := exec.Command(containerdBinary, args...) cmd := exec.Command(containerdBinary, args...)
// redirect containerd logs to docker logs // redirect containerd logs to docker logs
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} 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 { if err := cmd.Start(); err != nil {
return err return err
} }