code: func (p *Process) monitorCmd(cmd *exec.Cmd, stopped chan struct{}) {
  	err := cmd.Wait()
  	if !p.stopping.Load().(bool) {
  		p.Logger.Error("unexpectedly exit", "err", err)
  		shutdown.ExitWithCode(1)
  	}
  	close(stopped)
  }
docs: // monitorCmd waits for cmd to finish and reports an error if it was unexpected.
  // Also closes the stopped channel to notify other listeners that it has finished.