Skip to content

Commit

Permalink
add service stop before uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
zackattack01 committed Aug 8, 2024
1 parent 2b470b1 commit 07d6abc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ee/watchdog/controller_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ func RemoveService(serviceManager *mgr.Mgr) error {

defer existingService.Close()

// attempt to stop the service first, we don't care if this fails because we are going to
// remove the service next anyway (the removal happens faster if stopped first, but will
// happen eventually regardless)
existingService.Control(svc.Stop)

if err := backoff.WaitFor(func() error {
if err = existingService.Delete(); err != nil {
return err
Expand Down

0 comments on commit 07d6abc

Please sign in to comment.