1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

merge from ronnie

(This used to be ctdb commit f31e750760bd98e2214ea76f359824aca6f5826f)
This commit is contained in:
Andrew Tridgell 2007-05-24 10:10:02 +10:00
commit 3909d83eef

View File

@ -61,6 +61,7 @@ static void usage(void)
" getpid <vnn> get the pid of a ctdb daemon\n"
" dumpmemory <vnn|all> dump memory map to log\n"
" shutdown <vnn> shutdown a remote ctdb\n"
" recovery <vnn> trigger a recovery\n"
" freeze <vnn|all> freeze a node\n"
" thaw <vnn|all> thaw a node\n"
);
@ -373,6 +374,28 @@ static int control_shutdown(struct ctdb_context *ctdb, int argc, const char **ar
return 0;
}
/*
trigger a recovery
*/
static int control_recovery(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
ret = ctdb_ctrl_freeze(ctdb, timeval_current_ofs(timelimit, 0), CTDB_CURRENT_NODE);
if (ret != 0) {
printf("Unable to freeze node\n");
return ret;
}
ret = ctdb_ctrl_setrecmode(ctdb, timeval_current_ofs(timelimit, 0), CTDB_CURRENT_NODE, CTDB_RECOVERY_ACTIVE);
if (ret != 0) {
printf("Unable to set recovery mode\n");
return ret;
}
return 0;
}
/*
display recovery mode of a remote node
*/
@ -1056,6 +1079,7 @@ int main(int argc, const char *argv[])
{ "dumpmemory", control_dumpmemory },
{ "getpid", control_getpid },
{ "shutdown", control_shutdown },
{ "recovery", control_recovery },
{ "freeze", control_freeze },
{ "thaw", control_thaw },
};