close the sync pipe explicitly in exec

Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
lifubang
2024-02-06 16:33:41 +08:00
committed by lfbzhm
parent 02120488a4
commit d075058717
+5
View File
@@ -129,6 +129,11 @@ func (l *linuxSetnsInit) Init() error {
}
}
// Close the pipe to signal that we have completed our init.
// Please keep this because we don't want to get a pipe write error if
// there is an error from `execve` after all fds closed.
_ = l.pipe.Close()
// Close the log pipe fd so the parent's ForwardLogs can exit.
logrus.Debugf("setns_init: about to exec")
if err := l.logPipe.Close(); err != nil {