From 38c27b7e7f7b2f67a7c82cde182014ea8942eb53 Mon Sep 17 00:00:00 2001 From: Juanadelacuesta <8647634+Juanadelacuesta@users.noreply.github.com> Date: Wed, 23 Apr 2025 16:20:04 +0200 Subject: [PATCH] fix: make teh disctintion when for os.Interrupt --- command/agent/command.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) }