File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 11# Journal.d plugin
22@introduction
33
4+ ### Warning
5+
6+ ** Important:** If the ` journalctl ` process is stopped or killed, the ` file.d ` application will also be stopped.
7+
48### Config params
59@config-params |description
Original file line number Diff line number Diff line change 11# Journal.d plugin
22Reads ` journalctl ` output.
33
4+ ### Warning
5+
6+ ** Important:** If the ` journalctl ` process is stopped or killed, the ` file.d ` application will also be stopped.
7+
48### Config params
59** ` offsets_file ` ** * ` string ` * * ` required ` *
610
Original file line number Diff line number Diff line change 77 "io"
88 "os/exec"
99 "strings"
10+ "syscall"
1011
1112 "github.com/prometheus/client_golang/prometheus"
1213 "go.uber.org/zap"
@@ -94,10 +95,15 @@ func (r *journalReader) start() error {
9495 }
9596
9697 go r .readLines (out , r .config )
98+ go func () {
99+ if err := r .cmd .Wait (); err != nil {
100+ r .config .logger .Fatal ("journalctl command exited with error" , zap .Error (err ))
101+ }
102+ }()
97103
98104 return nil
99105}
100106
101107func (r * journalReader ) stop () error {
102- return r .cmd .Process .Kill ( )
108+ return r .cmd .Process .Signal ( syscall . SIGTERM )
103109}
You can’t perform that action at this time.
0 commit comments