1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

tools/ctdb: New command runstate to print current runstate

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit bf20c3ab090f75f59097b36186347cedb1c445d4)
This commit is contained in:
Martin Schwenke 2013-01-11 14:07:12 +11:00 committed by Amitay Isaacs
parent 77671b9ef5
commit 87eb70180a
2 changed files with 38 additions and 0 deletions

View File

@ -382,6 +382,23 @@ response from 3 time=0.000114 sec (2 clients)
</screen>
</refsect2>
<refsect2><title>runstate</title>
<para>
Print the runstate of the specified node. Runstates are used
to serialise important state transitions in CTDB, particularly
during startup.
</para>
<para>
Example: ctdb runstate
</para>
<para>
Example output:
</para>
<screen format="linespecific">
RUNNING
</screen>
</refsect2>
<refsect2><title>ifaces</title>
<para>
This command will display the list of network interfaces, which could

View File

@ -4372,6 +4372,26 @@ static int control_ping(struct ctdb_context *ctdb, int argc, const char **argv)
}
/*
get a node's runstate
*/
static int control_runstate(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
enum ctdb_runstate runstate;
ret = ctdb_ctrl_get_runstate(ctdb, TIMELIMIT(), options.pnn, &runstate);
if (ret == -1) {
printf("Unable to get runstate response from node %u\n",
options.pnn);
return -1;
}
printf("%s\n", runstate_to_string(runstate));
return 0;
}
/*
get a tunable
*/
@ -5804,6 +5824,7 @@ static const struct {
{ "status", control_status, true, false, "show node status" },
{ "uptime", control_uptime, true, false, "show node uptime" },
{ "ping", control_ping, true, false, "ping all nodes" },
{ "runstate", control_runstate, true, false, "get runstate of a node" },
{ "getvar", control_getvar, true, false, "get a tunable variable", "<name>"},
{ "setvar", control_setvar, true, false, "set a tunable variable", "<name> <value>"},
{ "listvars", control_listvars, true, false, "list tunable variables"},