Skip to content

Commit

Permalink
fix logging after domain stop/start
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
(cherry picked from commit a9db0e1)
  • Loading branch information
giggsoff authored and eriknordmark committed Oct 24, 2021
1 parent e51c079 commit b2a3e2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/pillar/containerd/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down

0 comments on commit b2a3e2b

Please sign in to comment.