diff --git a/command/agent/command.go b/command/agent/command.go index be13a0835..8201e4ff0 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -1039,12 +1039,19 @@ func (c *Command) handleSignals() int { c.Ui.Output("Terminal error found while reloading") return 1 } + sdNotify(sdSock, sdReady) - case os.Interrupt, syscall.SIGTERM: + case syscall.SIGTERM: if !c.agent.GetConfig().LeaveOnTerm { return 1 } + return c.terminateGracefully(signalCh, sdSock) + case os.Interrupt: + if !c.agent.GetConfig().LeaveOnInt { + return 1 + } + return c.terminateGracefully(signalCh, sdSock) }