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>
}
}
+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
*/
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);