Skip to content

Commit

Permalink
[Ingest Manager] Print a message confirming shutdown (#20948) (#20957)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpristas authored Sep 4, 2020
1 parent 1ca7bd4 commit edcd5cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions x-pack/elastic-agent/pkg/agent/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ func run(flags *globalFlags, streams *cli.IOStreams) error {
}
}
if breakout {
if !reexecing {
logger.Info("Shutting down Elastic Agent and sending last events...")
}
break
}
}

err = app.Stop()
if !reexecing {
logger.Info("Shutting down completed.")
return err
}
rex.ShutdownComplete()
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/agent/control/server/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func createListener(log *logger.Logger) (net.Listener, error) {
path := strings.TrimPrefix(control.Address(), "unix://")
if _, err := os.Stat(path); !os.IsNotExist(err) {
err = os.Remove(path)
if err != nil {
if err != nil && !os.IsNotExist(err) {
log.Errorf("%s", errors.New(err, fmt.Sprintf("Failed to cleanup %s", path), errors.TypeFilesystem, errors.M("path", path)))
}
}
Expand Down

0 comments on commit edcd5cb

Please sign in to comment.