Skip to content

Commit

Permalink
adding err to exit SecAgent. fixes hanging if there's no API key
Browse files Browse the repository at this point in the history
  • Loading branch information
modernplumbing committed Dec 27, 2022
1 parent c8ab6cf commit 9336915
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/security-agent/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ func RunAgent(ctx context.Context, pidfilePath string) (err error) {

if !coreconfig.Datadog.IsSet("api_key") {
log.Critical("no API key configured, exiting")
return nil

// A sleep is necessary so that sysV doesn't think the agent has failed
// to startup because of an error. Only applies on Debian 7.
time.Sleep(5 * time.Second)

return errAllComponentsDisabled
}

err = manager.ConfigureAutoExit(ctx)
Expand Down

0 comments on commit 9336915

Please sign in to comment.