From 3f80c15ecbbfa9dda4deab5fa3c167d7dc4c284a Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Fri, 20 Nov 2015 18:59:01 +0100 Subject: [PATCH] Update to most recent libbeat version and shared files --- Godeps/Godeps.json | 60 +++++++++---------- .../elastic/libbeat/service/service.go | 7 ++- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 8ddbfd90c50a..959052fdbfad 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -7,78 +7,78 @@ "Deps": [ { "ImportPath": "github.com/elastic/libbeat/beat", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/cfgfile", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/common", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/filters", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/logp", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/outputs", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/publisher", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/service", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/cfgfile", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/common", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/filters", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/logp", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/outputs", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/publisher", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/elastic/libbeat/service", - "Comment": "v1.0.0-rc1-68-g5313047", - "Rev": "531304787e67d86f958ca96e2e1516c4f1bc7c5c" + "Comment": "v1.0.0-rc2-3-ga35e184", + "Rev": "a35e1840d08381622fb4c428f8e1b122c0b42b29" }, { "ImportPath": "github.com/garyburd/redigo/internal", diff --git a/Godeps/_workspace/src/github.com/elastic/libbeat/service/service.go b/Godeps/_workspace/src/github.com/elastic/libbeat/service/service.go index fcc45a090a99..533b4cd73ed0 100644 --- a/Godeps/_workspace/src/github.com/elastic/libbeat/service/service.go +++ b/Godeps/_workspace/src/github.com/elastic/libbeat/service/service.go @@ -7,6 +7,7 @@ import ( "os/signal" "runtime" "runtime/pprof" + "sync" "syscall" "github.com/elastic/libbeat/logp" @@ -16,19 +17,21 @@ import ( // The stopFunction should break the loop in the Beat so that // the service shut downs gracefully. func HandleSignals(stopFunction func()) { + var callback sync.Once + // On ^C or SIGTERM, gracefully stop the sniffer sigc := make(chan os.Signal, 1) signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM) go func() { <-sigc logp.Debug("service", "Received sigterm/sigint, stopping") - stopFunction() + callback.Do(stopFunction) }() // Handle the Windows service events go ProcessWindowsControlEvents(func() { logp.Debug("service", "Received svc stop/shutdown request") - stopFunction() + callback.Do(stopFunction) }) }