Skip to content

Commit

Permalink
Fix journalctl leak
Browse files Browse the repository at this point in the history
This fixes the journalctl leak that occurs when a process that uses
cadvisor exits. See issues google#1725 and
kubernetes/kubernetes#34965.
  • Loading branch information
mtaufen committed Aug 23, 2017
1 parent 48f6b99 commit 3190c1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/oomparser/oomparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"path"
"regexp"
"strconv"
"syscall"
"time"

"github.com/google/cadvisor/utils"
Expand Down Expand Up @@ -167,6 +168,9 @@ func (self *OomParser) StreamOoms(outStream chan *OomInstance) {

func callJournalctl() (io.ReadCloser, error) {
cmd := exec.Command("journalctl", "-k", "-f")
cmd.SysProcAttr = &syscall.SysProcAttr{
Pdeathsig: syscall.SIGKILL,
}
readcloser, err := cmd.StdoutPipe()
if err != nil {
return nil, err
Expand Down

0 comments on commit 3190c1c

Please sign in to comment.