ctdb-recoverd: Add basic log reopening
authorMartin Schwenke <martin@meltin.net>
Thu, 30 Sep 2021 11:03:15 +0000 (21:03 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 17 Jan 2022 03:43:30 +0000 (03:43 +0000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index dfa6d0d089bce39560614bcc6d775fe121679882..408ac68351f7e78667781762216efb8e09f8c2f2 100644 (file)
@@ -2916,6 +2916,7 @@ static void monitor_cluster(struct ctdb_context *ctdb)
 {
        struct tevent_signal *se;
        struct ctdb_recoverd *rec;
+       bool status;
 
        DEBUG(DEBUG_NOTICE,("monitor_cluster starting\n"));
 
@@ -2935,6 +2936,15 @@ static void monitor_cluster(struct ctdb_context *ctdb)
        rec->priority_time = timeval_current();
        rec->frozen_on_inactive = false;
 
+       status = logging_setup_sighup_handler(rec->ctdb->ev,
+                                             rec,
+                                             NULL,
+                                             NULL);
+       if (!status) {
+               D_ERR("Failed to install SIGHUP handler\n");
+               exit(1);
+       }
+
        se = tevent_add_signal(ctdb->ev, ctdb, SIGTERM, 0,
                               recd_sig_term_handler, rec);
        if (se == NULL) {