summaryrefslogtreecommitdiff
path: root/ctdb/server
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2021-09-30 21:16:44 +1000
committerAmitay Isaacs <amitay@samba.org>2022-01-17 04:36:30 +0000
commit57a32cebdd834e24e69f524f8ffaa980472cde33 (patch)
tree1171b6df840d854435ff1eceec993e37d68f848f /ctdb/server
parent8e949a60828bae47a3636f051dcc86387b5fce23 (diff)
downloadsamba-57a32cebdd834e24e69f524f8ffaa980472cde33.tar.gz
ctdb-recoverd: Pass SIGHUP to running helper
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
Diffstat (limited to 'ctdb/server')
-rw-r--r--ctdb/server/ctdb_recoverd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 8df309bb601..761f00177ca 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -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);