mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 02:48:19 +00:00
ignore sigpipe signals to fix journalctl issue #2404
This commit is contained in:
parent
cbc180d3a4
commit
8b3ab100ef
@ -943,6 +943,7 @@ func (c *Command) Run(args []string) int {
|
|||||||
func (c *Command) handleSignals(config *Config, retryJoin <-chan struct{}, retryJoinWan <-chan struct{}) int {
|
func (c *Command) handleSignals(config *Config, retryJoin <-chan struct{}, retryJoinWan <-chan struct{}) int {
|
||||||
signalCh := make(chan os.Signal, 4)
|
signalCh := make(chan os.Signal, 4)
|
||||||
signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP)
|
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 for a signal
|
||||||
WAIT:
|
WAIT:
|
||||||
@ -964,6 +965,11 @@ WAIT:
|
|||||||
}
|
}
|
||||||
c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))
|
c.Ui.Output(fmt.Sprintf("Caught signal: %v", sig))
|
||||||
|
|
||||||
|
// Skip SIGPIPE signals
|
||||||
|
if sig == syscall.SIGPIPE {
|
||||||
|
goto WAIT
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this is a SIGHUP
|
// Check if this is a SIGHUP
|
||||||
if sig == syscall.SIGHUP {
|
if sig == syscall.SIGHUP {
|
||||||
if conf := c.handleReload(config); conf != nil {
|
if conf := c.handleReload(config); conf != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user