1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-04 09:44:20 +03:00

ctdb-daemon: Enable log reopening for recovery daemon

Pass on a SIGHUP to the recovery daemon, which will then reopen its
logs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke
2021-09-30 21:08:25 +10:00
committed by Amitay Isaacs
parent 4acfefed61
commit c554a325fe

View File

@@ -1488,6 +1488,16 @@ static void fork_only(void)
}
}
static void sighup_hook(void *private_data)
{
struct ctdb_context *ctdb = talloc_get_type_abort(private_data,
struct ctdb_context);
if (ctdb->recoverd_pid > 0) {
kill(ctdb->recoverd_pid, SIGHUP);
}
}
/*
start the protocol going as a daemon
*/
@@ -1551,8 +1561,8 @@ int ctdb_start_daemon(struct ctdb_context *ctdb,
status = logging_setup_sighup_handler(ctdb->ev,
ctdb,
NULL,
NULL);
sighup_hook,
ctdb);
if (!status) {
D_ERR("Failed to set up signal handler for SIGHUP\n");
exit(1);