From 9672e16323bd46ee366d922b856deabca9dfd232 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 16 Nov 2015 17:53:04 +0100 Subject: [PATCH] suricata: clean dump-config output When user asks for a configuration dump, it is useless to display the version and CPU info. Also initializing the log system conduct to overwrite the some log files and in particular suricata.log and this is annoying as a command should not interfere with a running daemon. --- src/suricata.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 8ddd79fd7a..afda5c922a 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2226,6 +2226,11 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } + if (suri.run_mode == RUNMODE_DUMP_CONFIG) { + ConfDump(); + exit(EXIT_SUCCESS); + } + /* Since our config is now loaded we can finish configurating the * logging module. */ SCLogLoadConfig(suri.daemon, suri.verbose); @@ -2234,11 +2239,6 @@ int main(int argc, char **argv) UtilCpuPrintSummary(); - if (suri.run_mode == RUNMODE_DUMP_CONFIG) { - ConfDump(); - exit(EXIT_SUCCESS); - } - if (PostConfLoadedSetup(&suri) != TM_ECODE_OK) { exit(EXIT_FAILURE); } -- 2.47.2