From: Eric Leblond Date: Mon, 16 Nov 2015 16:53:04 +0000 (+0100) Subject: suricata: clean dump-config output X-Git-Tag: suricata-3.0RC1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9672e16323bd46ee366d922b856deabca9dfd232;p=thirdparty%2Fsuricata.git 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. --- 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); }