mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user