From cd508d31cb11bd19963dc77cd0fb37865bf0ed80 Mon Sep 17 00:00:00 2001 From: Romain Baugue Date: Fri, 28 Feb 2020 10:32:44 +0100 Subject: [PATCH] Update the README --- README.md | 33 +++++++++++++++++++++------------ bin/rcoredumpd/main.go | 2 +- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d48f2a3..bd361e4 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,17 @@ _rcoredumpd_ is the indexation service. It listen on a TCP connection for incoming files and process them. ``` -Usage of rcoredumpd: +Usage of rcoredumpd: rcoredumpd [options] -bind string - address to listen to (default "localhost:1105") + address to listen to (default "localhost:1105") -conf string - configuration file to load (default "/etc/rcoredump/rcoredumpd.conf") + configuration file to load (default "/etc/rcoredump/rcoredumpd.conf") -dir string - path of the directory to store the coredumps into (default "/var/lib/rcoredumpd/") + path of the directory to store the coredumps into (default "/var/lib/rcoredumpd/") + -version + print the version of rcoredumpd ``` -Each connection yield a header file, a core dump and the binary that crashed. -All three are saved in the data directory as `.`. - ### `rcoredump` _rcoredump_ is the forwarding tool. It sends the core dump, the binary and a @@ -31,18 +30,28 @@ header with some additional informations to the indexing service. ``` Usage of rcoredump: rcoredump [options] -conf string - configuration file to load (default "/etc/rcoredump/rcoredump.conf") + configuration file to load (default "/etc/rcoredump/rcoredump.conf") -dest string - address of the destination host (default "localhost:1105") + address of the destination host (default "http://localhost:1105") + -filelog string + path of the file to log into ('-' for stdout) (default "-") + -send-binary + send the binary along with the dump (default true) -src string - path of the coredump to send to the host ('-' for stdin) (default "-") + path of the coredump to send to the host ('-' for stdin) (default "-") + -syslog + output logs to syslog + -version + print the version of rcoredum ``` On linux, you can use sysctl's `kernel.core_pattern` tunable to have the kernel invoke _rcoredump_ everytime a dump is generated. For example: -`kernel.core_pattern=|rcoredump %E %t`. +`kernel.core_pattern=|/path/to/rcoredump %E %t`. ## Logging All logging is done on stdout using the _logfmt_ format. This output can be -redirected easily enough using various utilities, like `logger` for syslog. +redirected easily enough using various utilities, like `logger` for syslog. For +convenience, the forwarder also accept a `syslog` flag to log using syslog, and +a `filelog` flag to log to a file. diff --git a/bin/rcoredumpd/main.go b/bin/rcoredumpd/main.go index 6d4bf89..5d42ab2 100644 --- a/bin/rcoredumpd/main.go +++ b/bin/rcoredumpd/main.go @@ -71,7 +71,7 @@ type service struct { func (s *service) configure() { fs := flag.NewFlagSet("rcoredumpd-"+Version, flag.ExitOnError) fs.Usage = func() { - fmt.Fprintln(fs.Output(), "Usage of rcoredumpd:") + fmt.Fprintln(fs.Output(), "Usage of rcoredumpd: rcoredumpd [options]") fs.PrintDefaults() } fs.StringVar(&s.bind, "bind", "localhost:1105", "address to listen to")