Skip to content

Commit

Permalink
Merge pull request #17 from papertrail/13-no-blank-pid-files
Browse files Browse the repository at this point in the history
No blank pid files
  • Loading branch information
Leon Sodhi committed Jul 15, 2014
2 parents 39552e6 + b649bf7 commit bacddd7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,14 @@ func (cm *ConfigManager) defaultPidFile() string {
if err != nil {
continue
}
tmpPidFile := fd.Name()
fd.Close()
err = os.Remove(tmpPidFile)
if err != nil {
// Die because the lockfile lib can't handle an existing blank file
log.Criticalf("Can't remove temp pid file. Details: %s", err.Error())
os.Exit(1)
}
return f
}
return "/tmp/remote_syslog.pid"
Expand Down

0 comments on commit bacddd7

Please sign in to comment.