[Opendnssec-commits] [svn.opendnssec.org/svn/dnssec] r6065 - branches/OpenDNSSEC-1.3 branches/OpenDNSSEC-1.3/auditor/m4 branches/OpenDNSSEC-1.3/conf branches/OpenDNSSEC-1.3/m4 branches/OpenDNSSEC-1.3/plugins/eppclient/m4 branches/OpenDNSSEC-1.3/signer/src/daemon branches/OpenDNSSEC-1.3/signer/src/parser trunk/OpenDNSSEC/conf trunk/OpenDNSSEC/m4 trunk/OpenDNSSEC/signer/src/daemon trunk/OpenDNSSEC/signer/src/parser

jerry at opendnssec.org jerry at opendnssec.org
Mon Jan 16 10:45:47 CET 2012


Author: jerry
Date: 2012-01-16 10:45:47 +0100 (Mon, 16 Jan 2012)
New Revision: 6065

Modified:
   branches/OpenDNSSEC-1.3/NEWS
   branches/OpenDNSSEC-1.3/auditor/m4/opendnssec_common.m4
   branches/OpenDNSSEC-1.3/conf/conf.rnc
   branches/OpenDNSSEC-1.3/conf/conf.xml.in
   branches/OpenDNSSEC-1.3/m4/opendnssec_common.m4
   branches/OpenDNSSEC-1.3/plugins/eppclient/m4/opendnssec_common.m4
   branches/OpenDNSSEC-1.3/signer/src/daemon/cfg.c
   branches/OpenDNSSEC-1.3/signer/src/parser/confparser.c
   branches/OpenDNSSEC-1.3/signer/src/parser/confparser.h
   trunk/OpenDNSSEC/conf/conf.rnc
   trunk/OpenDNSSEC/conf/conf.xml.in
   trunk/OpenDNSSEC/m4/opendnssec_common.m4
   trunk/OpenDNSSEC/signer/src/daemon/cfg.c
   trunk/OpenDNSSEC/signer/src/parser/confparser.c
   trunk/OpenDNSSEC/signer/src/parser/confparser.h
Log:
OPENDNSSEC-175: Signer Engine: Verbosity can now be set via conf.xml.

Modified: branches/OpenDNSSEC-1.3/NEWS
===================================================================
--- branches/OpenDNSSEC-1.3/NEWS	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/NEWS	2012-01-16 09:45:47 UTC (rev 6065)
@@ -10,6 +10,7 @@
   different pidfile will need to be specified with the -P flag.
 * ods-ksmutil: "zone delete" renames the signconf file; so that if the zone is
   put back the signer will not pick up the old file.
+* Signer Engine: Verbosity can now be set via conf.xml, default is 3.
 
 Bugfixes:
 * Signer Engine: A file descriptor for sockets with value zero is allowed.

Modified: branches/OpenDNSSEC-1.3/auditor/m4/opendnssec_common.m4
===================================================================
--- branches/OpenDNSSEC-1.3/auditor/m4/opendnssec_common.m4	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/auditor/m4/opendnssec_common.m4	2012-01-16 09:45:47 UTC (rev 6065)
@@ -77,7 +77,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_WORKDIR,       ["$OPENDNSSEC_SIGNER_WORKINGDIR"],  [Path to the OpenDNSSEC signer engine working directory])
 AC_DEFINE_UNQUOTED(ODS_SE_CFGFILE,       ["$OPENDNSSEC_CONFIG_FILE"],        [Path to the OpenDNSSEC config file])
 AC_DEFINE_UNQUOTED(ODS_SE_RNGDIR,        ["$OPENDNSSEC_SCHEMA_DIR"],         [Path to the OpenDNSSEC data files])
-AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE -vvv"], [Path to the OpenDNSSEC signer engine binary])
+AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE"],      [Path to the OpenDNSSEC signer engine binary])
 AC_DEFINE_UNQUOTED(ODS_SE_CLI,           ["$OPENDNSSEC_SIGNER_CLI"],         [Path to the OpenDNSSEC signer client binary])
 AC_DEFINE_UNQUOTED(ODS_SE_AUDITOR,       ["$OPENDNSSEC_SIGNER_AUDITOR"],     [Path to the OpenDNSSEC auditor binary])
 AC_DEFINE_UNQUOTED(ODS_SE_MAXLINE,       [1024],                             [Maximum line length that the OpenDNSSEC signer client can handle])

Modified: branches/OpenDNSSEC-1.3/conf/conf.rnc
===================================================================
--- branches/OpenDNSSEC-1.3/conf/conf.rnc	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/conf/conf.rnc	2012-01-16 09:45:47 UTC (rev 6065)
@@ -60,10 +60,12 @@
 	element Common {
 		# Configuration parameters for logging
 		element Logging {
+			element Verbosity { xsd:nonNegativeInteger }?,
+			 
 			element Syslog {
 				# syslog facility
 				element Facility { syslogFacility }
-			}
+			}?
 		}?,
 
 		# Location to find the KASP file

Modified: branches/OpenDNSSEC-1.3/conf/conf.xml.in
===================================================================
--- branches/OpenDNSSEC-1.3/conf/conf.xml.in	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/conf/conf.xml.in	2012-01-16 09:45:47 UTC (rev 6065)
@@ -28,6 +28,8 @@
 
 	<Common>
 		<Logging>
+			<!-- Command line verbosity will overwrite configure file -->
+			<Verbosity>3</Verbosity>
 			<Syslog><Facility>local0</Facility></Syslog>
 		</Logging>
 		

Modified: branches/OpenDNSSEC-1.3/m4/opendnssec_common.m4
===================================================================
--- branches/OpenDNSSEC-1.3/m4/opendnssec_common.m4	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/m4/opendnssec_common.m4	2012-01-16 09:45:47 UTC (rev 6065)
@@ -78,7 +78,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_WORKDIR,       ["$OPENDNSSEC_SIGNER_WORKINGDIR"],  [Path to the OpenDNSSEC signer engine working directory])
 AC_DEFINE_UNQUOTED(ODS_SE_CFGFILE,       ["$OPENDNSSEC_CONFIG_FILE"],        [Path to the OpenDNSSEC config file])
 AC_DEFINE_UNQUOTED(ODS_SE_RNGDIR,        ["$OPENDNSSEC_SCHEMA_DIR"],         [Path to the OpenDNSSEC data files])
-AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE -vvv"], [Path to the OpenDNSSEC signer engine binary])
+AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE"],      [Path to the OpenDNSSEC signer engine binary])
 AC_DEFINE_UNQUOTED(ODS_SE_CLI,           ["$OPENDNSSEC_SIGNER_CLI"],         [Path to the OpenDNSSEC signer client binary])
 AC_DEFINE_UNQUOTED(ODS_SE_AUDITOR,       ["$OPENDNSSEC_SIGNER_AUDITOR"],     [Path to the OpenDNSSEC auditor binary])
 AC_DEFINE_UNQUOTED(ODS_SE_MAXLINE,       [1024],                             [Maximum line length that the OpenDNSSEC signer client can handle])
@@ -87,6 +87,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_STOP_RESPONSE, ["Engine shut down."],              [Shutdown message for the OpenDNSSEC signer client])
 AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC,    [";ODSSE2"],                        [File magic for storing backups from the OpenDNSSEC signer engine])
 AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC_V1, [";ODSSE1"],                        [File magic for storing backups from the OpenDNSSEC signer engine])
+AC_DEFINE_UNQUOTED(ODS_SE_VERBOSITY,     [3],                                [Default verbosity])
 
 # auditor specific
 OPENDNSSEC_AUDITOR_KASPCHECK=$OPENDNSSEC_BIN_DIR/ods-kaspcheck

Modified: branches/OpenDNSSEC-1.3/plugins/eppclient/m4/opendnssec_common.m4
===================================================================
--- branches/OpenDNSSEC-1.3/plugins/eppclient/m4/opendnssec_common.m4	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/plugins/eppclient/m4/opendnssec_common.m4	2012-01-16 09:45:47 UTC (rev 6065)
@@ -77,7 +77,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_WORKDIR,       ["$OPENDNSSEC_SIGNER_WORKINGDIR"],  [Path to the OpenDNSSEC signer engine working directory])
 AC_DEFINE_UNQUOTED(ODS_SE_CFGFILE,       ["$OPENDNSSEC_CONFIG_FILE"],        [Path to the OpenDNSSEC config file])
 AC_DEFINE_UNQUOTED(ODS_SE_RNGDIR,        ["$OPENDNSSEC_SCHEMA_DIR"],         [Path to the OpenDNSSEC data files])
-AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE -vvv"], [Path to the OpenDNSSEC signer engine binary])
+AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE"],      [Path to the OpenDNSSEC signer engine binary])
 AC_DEFINE_UNQUOTED(ODS_SE_CLI,           ["$OPENDNSSEC_SIGNER_CLI"],         [Path to the OpenDNSSEC signer client binary])
 AC_DEFINE_UNQUOTED(ODS_SE_AUDITOR,       ["$OPENDNSSEC_SIGNER_AUDITOR"],     [Path to the OpenDNSSEC auditor binary])
 AC_DEFINE_UNQUOTED(ODS_SE_MAXLINE,       [1024],                             [Maximum line length that the OpenDNSSEC signer client can handle])

Modified: branches/OpenDNSSEC-1.3/signer/src/daemon/cfg.c
===================================================================
--- branches/OpenDNSSEC-1.3/signer/src/daemon/cfg.c	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/signer/src/daemon/cfg.c	2012-01-16 09:45:47 UTC (rev 6065)
@@ -108,7 +108,13 @@
         ecfg->use_syslog = parse_conf_use_syslog(cfgfile);
         ecfg->num_worker_threads = parse_conf_worker_threads(cfgfile);
         ecfg->num_signer_threads = parse_conf_signer_threads(cfgfile);
-        ecfg->verbosity = cmdline_verbosity;
+        /* If any verbosity has been specified at cmd line we will use that */
+        if (cmdline_verbosity > 0) {
+        	ecfg->verbosity = cmdline_verbosity;
+        }
+        else {
+        	ecfg->verbosity = parse_conf_verbosity(cfgfile);
+        }
         ecfg->num_adapters = 0;
 
         /* done */

Modified: branches/OpenDNSSEC-1.3/signer/src/parser/confparser.c
===================================================================
--- branches/OpenDNSSEC-1.3/signer/src/parser/confparser.c	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/signer/src/parser/confparser.c	2012-01-16 09:45:47 UTC (rev 6065)
@@ -484,7 +484,23 @@
     return 0;
 }
 
+int
+parse_conf_verbosity(const char* cfgfile)
+{
+	int verbosity = ODS_SE_VERBOSITY;
+    const char* str = parse_conf_string(cfgfile,
+        "//Configuration/Common/Logging/Verbosity",
+        0);
+    if (str) {
+        if (strlen(str) > 0) {
+        	verbosity = atoi(str);
+        }
+        free((void*)str);
+    }
+    return verbosity;
+}
 
+
 int
 parse_conf_worker_threads(const char* cfgfile)
 {

Modified: branches/OpenDNSSEC-1.3/signer/src/parser/confparser.h
===================================================================
--- branches/OpenDNSSEC-1.3/signer/src/parser/confparser.h	2012-01-12 11:02:41 UTC (rev 6064)
+++ branches/OpenDNSSEC-1.3/signer/src/parser/confparser.h	2012-01-16 09:45:47 UTC (rev 6065)
@@ -113,6 +113,7 @@
 
 /** Common */
 int parse_conf_use_syslog(const char* cfgfile);
+int parse_conf_verbosity(const char* cfgfile);
 
 /** Signer specific */
 int parse_conf_worker_threads(const char* cfgfile);

Modified: trunk/OpenDNSSEC/conf/conf.rnc
===================================================================
--- trunk/OpenDNSSEC/conf/conf.rnc	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/conf/conf.rnc	2012-01-16 09:45:47 UTC (rev 6065)
@@ -60,10 +60,12 @@
 	element Common {
 		# Configuration parameters for logging
 		element Logging {
+			element Verbosity { xsd:nonNegativeInteger }?,
+			 
 			element Syslog {
 				# syslog facility
 				element Facility { syslogFacility }
-			}
+			}?
 		}?,
 
 		# Location to find the KASP file

Modified: trunk/OpenDNSSEC/conf/conf.xml.in
===================================================================
--- trunk/OpenDNSSEC/conf/conf.xml.in	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/conf/conf.xml.in	2012-01-16 09:45:47 UTC (rev 6065)
@@ -28,6 +28,8 @@
 
 	<Common>
 		<Logging>
+			<!-- Command line verbosity will overwrite configure file -->
+			<Verbosity>3</Verbosity>
 			<Syslog><Facility>local0</Facility></Syslog>
 		</Logging>
 		

Modified: trunk/OpenDNSSEC/m4/opendnssec_common.m4
===================================================================
--- trunk/OpenDNSSEC/m4/opendnssec_common.m4	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/m4/opendnssec_common.m4	2012-01-16 09:45:47 UTC (rev 6065)
@@ -77,7 +77,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_WORKDIR,       ["$OPENDNSSEC_SIGNER_WORKINGDIR"],  [Path to the OpenDNSSEC signer engine working directory])
 AC_DEFINE_UNQUOTED(ODS_SE_CFGFILE,       ["$OPENDNSSEC_CONFIG_FILE"],        [Path to the OpenDNSSEC config file])
 AC_DEFINE_UNQUOTED(ODS_SE_RNGDIR,        ["$OPENDNSSEC_SCHEMA_DIR"],         [Path to the OpenDNSSEC data files])
-AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE -vvv"], [Path to the OpenDNSSEC signer engine binary])
+AC_DEFINE_UNQUOTED(ODS_SE_ENGINE,        ["$OPENDNSSEC_SIGNER_ENGINE"],      [Path to the OpenDNSSEC signer engine binary])
 AC_DEFINE_UNQUOTED(ODS_SE_CLI,           ["$OPENDNSSEC_SIGNER_CLI"],         [Path to the OpenDNSSEC signer client binary])
 AC_DEFINE_UNQUOTED(ODS_SE_MAXLINE,       [1024],                             [Maximum line length that the OpenDNSSEC signer client can handle])
 AC_DEFINE_UNQUOTED(ODS_SE_MAX_BACKOFF,   [3600],                             [Number of seconds the OpenDNSSEC signer engine should backoff when a task failed])
@@ -85,6 +85,7 @@
 AC_DEFINE_UNQUOTED(ODS_SE_STOP_RESPONSE, ["Engine shut down."],              [Shutdown message for the OpenDNSSEC signer client])
 AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC,    [";ODSSE2"],                        [File magic for storing backups from the OpenDNSSEC signer engine])
 AC_DEFINE_UNQUOTED(ODS_SE_FILE_MAGIC_V1, [";ODSSE1"],                        [File magic for storing backups from the OpenDNSSEC signer engine])
+AC_DEFINE_UNQUOTED(ODS_SE_VERBOSITY,     [3],                                [Default verbosity])
 
 # enforcer specific
 OPENDNSSEC_ENFORCER_CONTROL=$OPENDNSSEC_SBIN_DIR/ods-control

Modified: trunk/OpenDNSSEC/signer/src/daemon/cfg.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/cfg.c	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/signer/src/daemon/cfg.c	2012-01-16 09:45:47 UTC (rev 6065)
@@ -96,7 +96,13 @@
         ecfg->use_syslog = parse_conf_use_syslog(cfgfile);
         ecfg->num_worker_threads = parse_conf_worker_threads(cfgfile);
         ecfg->num_signer_threads = parse_conf_signer_threads(cfgfile);
-        ecfg->verbosity = cmdline_verbosity;
+        /* If any verbosity has been specified at cmd line we will use that */
+        if (cmdline_verbosity > 0) {
+        	ecfg->verbosity = cmdline_verbosity;
+        }
+        else {
+        	ecfg->verbosity = parse_conf_verbosity(cfgfile);
+        }
         ecfg->interfaces = parse_conf_listener(allocator, cfgfile);
         /* done */
         ods_fclose(cfgfd);

Modified: trunk/OpenDNSSEC/signer/src/parser/confparser.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/parser/confparser.c	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/signer/src/parser/confparser.c	2012-01-16 09:45:47 UTC (rev 6065)
@@ -492,7 +492,23 @@
     return 0;
 }
 
+int
+parse_conf_verbosity(const char* cfgfile)
+{
+	int verbosity = ODS_SE_VERBOSITY;
+    const char* str = parse_conf_string(cfgfile,
+        "//Configuration/Common/Logging/Verbosity",
+        0);
+    if (str) {
+        if (strlen(str) > 0) {
+        	verbosity = atoi(str);
+        }
+        free((void*)str);
+    }
+    return verbosity;
+}
 
+
 int
 parse_conf_worker_threads(const char* cfgfile)
 {

Modified: trunk/OpenDNSSEC/signer/src/parser/confparser.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/parser/confparser.h	2012-01-12 11:02:41 UTC (rev 6064)
+++ trunk/OpenDNSSEC/signer/src/parser/confparser.h	2012-01-16 09:45:47 UTC (rev 6065)
@@ -112,6 +112,7 @@
 
 /** Common */
 int parse_conf_use_syslog(const char* cfgfile);
+int parse_conf_verbosity(const char* cfgfile);
 
 /** Signer specific */
 int parse_conf_worker_threads(const char* cfgfile);




More information about the Opendnssec-commits mailing list