diff --git a/helper/winsvc/service_windows.go b/helper/winsvc/service_windows.go index 306de08cb1b..0f71e18bbe7 100644 --- a/helper/winsvc/service_windows.go +++ b/helper/winsvc/service_windows.go @@ -13,6 +13,7 @@ func init() { if err != nil { panic(err) } + // Cannot run as a service when running interactively if interactive { return } @@ -32,8 +33,8 @@ func (serviceWindows) Execute(args []string, r <-chan wsvc.ChangeRequest, s chan case wsvc.Interrogate: s <- c.CurrentStatus case wsvc.Stop, wsvc.Shutdown: - chanGraceExit <- 1 s <- wsvc.Status{State: wsvc.StopPending} + chanGraceExit <- 1 return false, 0 } }