Skip to content

Commit

Permalink
Merge pull request elastic#185 from tsg/winservice
Browse files Browse the repository at this point in the history
Basic windows service functionality
  • Loading branch information
tsg committed Jul 24, 2015
2 parents 5426282 + 2886941 commit 84ee865
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Godeps/_workspace/src/github.com/elastic/libbeat/logp/log.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/elastic/libbeat/filters/nop"
"github.com/elastic/libbeat/logp"
"github.com/elastic/libbeat/publisher"
"github.com/elastic/libbeat/service"

"github.com/elastic/packetbeat/config"
"github.com/elastic/packetbeat/procs"
Expand Down Expand Up @@ -231,9 +232,14 @@ func main() {
go func() {
<-sigc
logp.Debug("signal", "Received sigterm/sigint, stopping")
sniff.Stop()
}()

// Handle the Windows service events
go service.ProcessWindowsControlEvents(func() {
logp.Debug("signal", "Received svc stop/shutdown request")
sniff.Stop()
})

// Startup successful, disable stderr logging if requested by
// cmdline flag
logp.SetStderr()
Expand Down

0 comments on commit 84ee865

Please sign in to comment.