mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
merge from ronnie
(This used to be ctdb commit 0aa6e04438aa5ec727815689baa19544df042cf7)
This commit is contained in:
parent
d38fbaa38b
commit
37861932ce
@ -366,6 +366,7 @@ struct ctdb_context {
|
||||
struct _trbt_tree_t *server_ids;
|
||||
const char *event_script_dir;
|
||||
const char *default_public_interface;
|
||||
pid_t ctdbd_pid;
|
||||
pid_t recoverd_pid;
|
||||
bool done_startup;
|
||||
const char *node_ip;
|
||||
|
@ -1821,6 +1821,12 @@ again:
|
||||
/* we only check for recovery once every second */
|
||||
ctdb_wait_timeout(ctdb, ctdb->tunable.recover_interval);
|
||||
|
||||
/* verify that the main daemon is still running */
|
||||
if (kill(ctdb->ctdbd_pid, 0) != 0) {
|
||||
DEBUG(0,("CTDB daemon is no longer available. Shutting down recovery daemon\n"));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (rec->election_timeout) {
|
||||
/* an election is in progress */
|
||||
goto again;
|
||||
@ -2275,6 +2281,8 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctdb->ctdbd_pid = getpid();
|
||||
|
||||
ctdb->recoverd_pid = fork();
|
||||
if (ctdb->recoverd_pid == -1) {
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user