From: Martin Schwenke Date: Thu, 30 Sep 2021 11:16:44 +0000 (+1000) Subject: ctdb-recoverd: Pass SIGHUP to running helper X-Git-Tag: tdb-1.4.6~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57a32cebdd834e24e69f524f8ffaa980472cde33;p=thirdparty%2Fsamba.git 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 Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Mon Jan 17 04:36:30 UTC 2022 on sn-devel-184 --- 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);