From b2a3e2b317f9848aaed5236f9b7846a1bb8aac6b Mon Sep 17 00:00:00 2001 From: Petr Fedchenkov Date: Tue, 19 Oct 2021 16:46:32 +0300 Subject: [PATCH] fix logging after domain stop/start Signed-off-by: Petr Fedchenkov (cherry picked from commit a9db0e1a722aede2b7db8d0f46b25e7d9602cc0f) --- pkg/pillar/containerd/logging.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/pillar/containerd/logging.go b/pkg/pillar/containerd/logging.go index 255b544831..51a7e553fb 100644 --- a/pkg/pillar/containerd/logging.go +++ b/pkg/pillar/containerd/logging.go @@ -94,7 +94,7 @@ type remoteLog struct { // Path returns the name of a FIFO connected to the logging daemon. func (r *remoteLog) Path(n string) string { path := filepath.Join(r.fifoDir, n+".log") - if err := syscall.Mkfifo(path, 0600); err != nil { + if err := syscall.Mkfifo(path, 0600); err != nil && err.(syscall.Errno) != syscall.EEXIST { return "/dev/null" } logrus.Infof("Creating %s at %s", "func", logutils.GetMyStack()) @@ -103,7 +103,7 @@ func (r *remoteLog) Path(n string) string { // containerd opens it when the task is started. fd, err := syscall.Open(path, syscall.O_RDONLY, 0) if err != nil { - // Should never happen: we just created the fifo + // Should never happen: we just checked the fifo logrus.Printf("failed to open fifo %s: %s", path, err) } defer syscall.Close(fd)