From 8aee2b805aa583b29bf284508d88dc5fc856ef97 Mon Sep 17 00:00:00 2001 From: vaLentin chernoZemski Date: Wed, 29 Mar 2017 09:46:58 +0300 Subject: [PATCH] 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. --- command/agent/command.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index 78ae49ffa..80ee2f8d1 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -1167,13 +1167,14 @@ WAIT: // Agent is already shutdown! 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 { goto WAIT } + c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig)) + // Check if this is a SIGHUP if sig == syscall.SIGHUP { conf, err := c.handleReload(config)