diff --git a/command/agent/command.go b/command/agent/command.go index 8e999c60a..7d756710e 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -474,7 +474,7 @@ func (c *Command) Run(args []string) int { // handleSignals blocks until we get an exit-causing signal func (c *Command) handleSignals(config *Config) int { signalCh := make(chan os.Signal, 4) - signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP) + signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGPIPE) // Wait for a signal WAIT: @@ -489,6 +489,11 @@ WAIT: } c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig)) + // Skip any SIGPIPE signal (See issue #1798) + if sig == syscall.SIGPIPE { + goto WAIT + } + // Check if this is a SIGHUP if sig == syscall.SIGHUP { if conf := c.handleReload(config); conf != nil {