ctdbd: Start logging process earlier
authorMartin Schwenke <martin@meltin.net>
Thu, 10 Jan 2013 05:48:39 +0000 (16:48 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 24 May 2013 04:08:07 +0000 (14:08 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

server/ctdb_daemon.c

index f59b9b2edf2f00dc3dac301f997d5cbf8f3b2c2d..edbc34c7a1f6814428dc2064f145794134bcfa79 100644 (file)
@@ -1200,6 +1200,12 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog,
        }
 
        ctdb_set_child_logging(ctdb);
+       if (use_syslog) {
+               if (start_syslog_daemon(ctdb)) {
+                       DEBUG(DEBUG_CRIT, ("Failed to start syslog daemon\n"));
+                       exit(10);
+               }
+       }
 
        /* initialize statistics collection */
        ctdb_statistics_init(ctdb);
@@ -1303,13 +1309,6 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog,
                exit(1);
        }
 
-       if (use_syslog) {
-               if (start_syslog_daemon(ctdb)) {
-                       DEBUG(DEBUG_CRIT, ("Failed to start syslog daemon\n"));
-                       exit(10);
-               }
-       }
-
        ctdb_lockdown_memory(ctdb);
          
        /* go into a wait loop to allow other nodes to complete */