Merge branch 'collectd-4.0' into collectd-4.1
[collectd.git] / src / collectd.c
index 0986e40..4fbd5c0 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "plugin.h"
 #include "configfile.h"
+#include "types_list.h"
 
 /*
  * Global variables
@@ -213,6 +214,7 @@ static int do_init (void)
        }
 #endif
 
+       read_types_list ();
        plugin_init_all ();
 
        return (0);
@@ -318,6 +320,7 @@ int main (int argc, char **argv)
        struct sigaction sigIntAction;
        struct sigaction sigTermAction;
        char *configfile = CONFIGFILE;
+       int test_config  = 0;
        const char *basedir;
 #if COLLECT_DAEMON
        struct sigaction sigChldAction;
@@ -330,7 +333,7 @@ int main (int argc, char **argv)
        {
                int c;
 
-               c = getopt (argc, argv, "hC:"
+               c = getopt (argc, argv, "htC:"
 #if COLLECT_DAEMON
                                "fP:"
 #endif
@@ -344,6 +347,9 @@ int main (int argc, char **argv)
                        case 'C':
                                configfile = optarg;
                                break;
+                       case 't':
+                               test_config = 1;
+                               break;
 #if COLLECT_DAEMON
                        case 'P':
                                global_option_set ("PIDFile", optarg);
@@ -395,6 +401,9 @@ int main (int argc, char **argv)
        if (init_global_variables () != 0)
                return (1);
 
+       if (test_config)
+               return (0);
+
 #if COLLECT_DAEMON
        /*
         * fork off child