diff --git a/internal/pkg/agent/cmd/enroll_cmd.go b/internal/pkg/agent/cmd/enroll_cmd.go index 4dd721cdef1..940b1da3725 100644 --- a/internal/pkg/agent/cmd/enroll_cmd.go +++ b/internal/pkg/agent/cmd/enroll_cmd.go @@ -290,6 +290,8 @@ func (c *enrollCmd) Execute(ctx context.Context, streams *cli.IOStreams) error { } }() + time.Sleep(5 * time.Second) + if c.agentProc == nil && !c.options.SkipDaemonRestart { if err = c.daemonReloadWithBackoff(ctx); err != nil { c.log.Errorf("Elastic Agent might not be running; unable to trigger restart: %v", err)