]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
suricata: clean dump-config output
authorEric Leblond <eric@regit.org>
Mon, 16 Nov 2015 16:53:04 +0000 (17:53 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Nov 2015 12:59:55 +0000 (13:59 +0100)
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

index 8ddd79fd7a603fdf43834a820d57bb62952fd29d..afda5c922a02b352450657fc4394a78e87a5d19a 100644 (file)
@@ -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);
     }