]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recoverd: Pass SIGHUP to running helper
authorMartin Schwenke <martin@meltin.net>
Thu, 30 Sep 2021 11:16:44 +0000 (21:16 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 17 Jan 2022 04:36:30 +0000 (04:36 +0000)
The recovery and takeover helpers can run for a while and generate
non-trivial logs, so have them reopen their logs to support log
rotation.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jan 17 04:36:30 UTC 2022 on sn-devel-184

ctdb/server/ctdb_recoverd.c

index 8df309bb601fd7bc93100c80458a964643e074bf..761f00177ca0dd3f1f87ba8c726311655095f4fa 100644 (file)
@@ -2913,6 +2913,16 @@ done:
        }
 }
 
+static void recd_sighup_hook(void *private_data)
+{
+       struct ctdb_recoverd *rec = talloc_get_type_abort(
+               private_data, struct ctdb_recoverd);
+
+       if (rec->helper_pid > 0) {
+               kill(rec->helper_pid, SIGHUP);
+       }
+}
+
 /*
   the main monitoring loop
  */
@@ -2943,8 +2953,8 @@ static void monitor_cluster(struct ctdb_context *ctdb)
 
        status = logging_setup_sighup_handler(rec->ctdb->ev,
                                              rec,
-                                             NULL,
-                                             NULL);
+                                             recd_sighup_hook,
+                                             rec);
        if (!status) {
                D_ERR("Failed to install SIGHUP handler\n");
                exit(1);