mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-recoverd: Add log reopening on SIGHUP to helpers
Recovery and takeover helpers can run for a while and generate non-trivial logs. They should support log reopening. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
51f0380e83
commit
97a45f6f25
@ -3121,6 +3121,7 @@ int main(int argc, char *argv[])
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
struct tevent_context *ev;
|
||||
struct ctdb_client_context *client;
|
||||
bool status;
|
||||
int ret = 0;
|
||||
struct tevent_req *req;
|
||||
uint32_t generation;
|
||||
@ -3160,6 +3161,12 @@ int main(int argc, char *argv[])
|
||||
goto failed;
|
||||
}
|
||||
|
||||
status = logging_setup_sighup_handler(ev, mem_ctx, NULL, NULL);
|
||||
if (!status) {
|
||||
D_ERR("logging_setup_sighup_handler() failed\n");
|
||||
goto failed;
|
||||
}
|
||||
|
||||
ret = ctdb_client_init(mem_ctx, ev, sockpath, &client);
|
||||
if (ret != 0) {
|
||||
D_ERR("ctdb_client_init() failed, ret=%d\n", ret);
|
||||
|
@ -1193,6 +1193,7 @@ int main(int argc, const char *argv[])
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct tevent_context *ev;
|
||||
struct ctdb_client_context *client;
|
||||
bool status;
|
||||
int ret;
|
||||
struct tevent_req *req;
|
||||
uint32_t *force_rebalance_nodes = NULL;
|
||||
@ -1235,6 +1236,13 @@ int main(int argc, const char *argv[])
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = logging_setup_sighup_handler(ev, mem_ctx, NULL, NULL);
|
||||
if (!status) {
|
||||
D_ERR("logging_setup_sighup_handler() failed\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = ctdb_client_init(mem_ctx, ev, sockpath, &client);
|
||||
if (ret != 0) {
|
||||
D_ERR("ctdb_client_init() failed, ret=%d\n", ret);
|
||||
|
Loading…
Reference in New Issue
Block a user