From 3cbf6b8168dacd4282c6b8b149f0378d9031f2e8 Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Mon, 18 Apr 2016 21:06:35 -0400 Subject: [PATCH] Add missing calls to service.BeforeRun() and service.Cleanup(). They were dropped during the refactor in #1249. --- CHANGELOG.asciidoc | 1 + libbeat/beat/beat.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 1b12e16d1b7..f5bdc228673 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -38,6 +38,7 @@ https://github.com/elastic/beats/compare/v5.0.0-alpha1...master[Check the HEAD d - Drain response buffers when pipelining is used by redis output. {pull}1353[1353] - Unterminated environment variable expressions in config files will now cause an error {pull}1389[1389] - Fix issue with the automatic template loading when Elasticsearch is not available on Beat start. {issue}1321[1321] +- Fix bug affecting -cpuprofile, -memprofile, and -httpprof CLI flags {pull}1415[1415] *Packetbeat* diff --git a/libbeat/beat/beat.go b/libbeat/beat/beat.go index cd54556c988..84d5d81a988 100644 --- a/libbeat/beat/beat.go +++ b/libbeat/beat/beat.go @@ -262,6 +262,7 @@ func (bc *instance) run() error { // reaches the setup stage. func (bc *instance) cleanup() error { logp.Info("%s cleanup", bc.data.Name) + defer svc.Cleanup() return bc.beater.Cleanup(bc.data) } @@ -291,6 +292,7 @@ func (bc *instance) launch(exit bool) error { return err } + svc.BeforeRun() svc.HandleSignals(bc.beater.Stop) err = bc.run() return err