[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4147 - trunk/OpenDNSSEC/signer/src/daemon

Matthijs Mekking matthijs at nlnetlabs.nl
Mon Nov 1 10:46:05 CET 2010


Author: matthijs
Date: 2010-11-01 10:46:05 +0100 (Mon, 01 Nov 2010)
New Revision: 4147

Modified:
   trunk/OpenDNSSEC/signer/src/daemon/engine.c
Log:
change order in setup



Modified: trunk/OpenDNSSEC/signer/src/daemon/engine.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-10-28 22:26:15 UTC (rev 4146)
+++ trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-11-01 09:46:05 UTC (rev 4147)
@@ -481,7 +481,23 @@
         }
     }
     engine->pid = getpid();
+    /* make common with enforcer */
+    if (write_pidfile(engine->config->pid_filename, engine->pid) == -1) {
+        se_log_error("setup failed: unable to write pid file");
+        cmdhandler_cleanup(engine->cmdhandler);
+        engine->cmdhandler = NULL;
+        return 1;
+    }
+    se_log_verbose("running as pid %lu", (unsigned long) engine->pid);
 
+    /* start command handler */
+    if (engine_start_cmdhandler(engine) != 0) {
+        se_log_error("setup failed: unable to start command handler");
+        cmdhandler_cleanup(engine->cmdhandler);
+        engine->cmdhandler = NULL;
+        return 1;
+    }
+
     /* catch signals */
     signal_set_engine(engine);
     action.sa_handler = signal_handler;
@@ -500,23 +516,6 @@
         return 1;
     }
 
-    /* start command handler */
-    if (engine_start_cmdhandler(engine) != 0) {
-        se_log_error("setup failed: unable to start command handler");
-        cmdhandler_cleanup(engine->cmdhandler);
-        engine->cmdhandler = NULL;
-        return 1;
-    }
-
-    /* make common with enforcer */
-    if (write_pidfile(engine->config->pid_filename, engine->pid) == -1) {
-        se_log_error("setup failed: unable to write pid file");
-        cmdhandler_cleanup(engine->cmdhandler);
-        engine->cmdhandler = NULL;
-        return 1;
-    }
-    se_log_verbose("running as pid %lu", (unsigned long) engine->pid);
-
     /* set up the work floor */
     engine->tasklist = tasklist_create(); /* tasks */
     engine->zonelist = zonelist_create(); /* zones */
@@ -922,7 +921,7 @@
         se_log_error("cfgfile %s has errors", cfgfile?cfgfile:"(null)");
     }
     if (info) {
-        engine_config_print(stdout, engine->config);
+        engine_config_print(stdout, engine->config); /* for debugging */
         goto earlyexit;
     }
 




More information about the Opendnssec-commits mailing list