1
0
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:
Andrew Tridgell 2008-01-07 16:17:22 +11:00
parent d38fbaa38b
commit 37861932ce
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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;