Supress signal logging on SIGPIPE. Should address #2768

When consul-template is communicating with consul and the job is done, consul thread receives SIGPIPE.

This cause the logs to be filled "Caught signal: broken pipe" and they does not bring any usefull info with them.

Skipping those.
This commit is contained in:
vaLentin chernoZemski 2017-03-29 09:46:58 +03:00
parent 15b60b07f0
commit 8aee2b805a

View file

@ -1167,13 +1167,14 @@ WAIT:
// Agent is already shutdown! // Agent is already shutdown!
return 0 return 0
} }
c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))
// Skip SIGPIPE signals // Skip SIGPIPE signals and skip logging whenever such signal is received as well
if sig == syscall.SIGPIPE { if sig == syscall.SIGPIPE {
goto WAIT goto WAIT
} }
c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))
// Check if this is a SIGHUP // Check if this is a SIGHUP
if sig == syscall.SIGHUP { if sig == syscall.SIGHUP {
conf, err := c.handleReload(config) conf, err := c.handleReload(config)