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:
commit
8eb8a1d6b8
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue