add an atexit() that will print "CTDB daemon shutting down" in the log
authorRonnie Sahlberg <sahlberg@ronnie>
Mon, 20 Aug 2007 23:43:53 +0000 (09:43 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Mon, 20 Aug 2007 23:43:53 +0000 (09:43 +1000)
when the main daemon exits

server/ctdb_daemon.c

index 78c67b3ccc781b598331fdf436e4663f6a769ce2..f216ca4365d74f092d602887d4cc73b50b7bc9a4 100644 (file)
@@ -616,6 +616,10 @@ static int unlink_destructor(const char *name)
        return 0;
 }
 
+static void print_exit_message(void)
+{
+       DEBUG(0,("CTDB daemon shutting down\n"));
+}
 
 /*
   start the protocol going as a daemon
@@ -640,6 +644,9 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
                return 0;
        }
 
+       /* Make sure we log something when the daemon terminates */
+       atexit(print_exit_message);
+
        tdb_reopen_all(False);
 
        if (do_fork) {