Clear nofity socket from containerd env
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 365401703d
)
This commit is contained in:
parent
4d7d1736bd
commit
c5d179891f
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