Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #135 from WeiZhang555/fix-logger
Browse files Browse the repository at this point in the history
log: init logrus always before use it
  • Loading branch information
Sebastien Boeuf authored Feb 5, 2018
2 parents a371c5d + acdb463 commit 32142e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ func main() {
},
}

if err = s.initLogger(); err != nil {
return
}

// Check if this agent has been run as the init process.
if os.Getpid() == 1 {
// pivot_root won't work, see
Expand All @@ -494,10 +498,6 @@ func main() {
}
}

if err = s.initLogger(); err != nil {
return
}

// Set agent as subreaper.
if err = s.setSubreaper(); err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (r *reaper) reap() error {
rus unix.Rusage
)

// When running new processes, libcontainer expects to wait
// When running new processes, agent expects to wait
// for the first process actually spawning the container.
// This lock allows any code starting a new process to take
// the lock prior to the start of this new process, preventing
Expand Down

0 comments on commit 32142e7

Please sign in to comment.