diff --git a/client/internal/connect_lifecycle.go b/client/internal/connect_lifecycle.go index 7515563d2..2e890aacb 100644 --- a/client/internal/connect_lifecycle.go +++ b/client/internal/connect_lifecycle.go @@ -158,7 +158,7 @@ func (s *supervisor) handleStart(cmd lifecycleCmd) { } func (s *supervisor) handleStop(cmd lifecycleCmd) { - if s.curStart == nil { + if !s.isRunningInternal() { notify(cmd.done, nil) return } @@ -172,7 +172,7 @@ func (s *supervisor) handleStop(cmd lifecycleCmd) { // daemon-side lock — that is what an explicit restart (e.g. MDM config change) // needs to avoid a window where the client is observably stopped. func (s *supervisor) handleRestart(cmd lifecycleCmd) { - if s.curStart != nil { + if s.isRunningInternal() { s.stopCurrentRun() } s.handleStart(cmd)