fix: make teh disctintion when for os.Interrupt

This commit is contained in:
Juanadelacuesta
2025-04-23 16:20:04 +02:00
parent adf038b495
commit 38c27b7e7f

View File

@@ -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)
}