Skip to content

Commit

Permalink
send StopPending to windows before sending graceful exit
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Nov 6, 2019
1 parent a9b8d15 commit f107b52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper/winsvc/service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func init() {
if err != nil {
panic(err)
}
// Cannot run as a service when running interactively
if interactive {
return
}
Expand All @@ -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
}
}
Expand Down

0 comments on commit f107b52

Please sign in to comment.