</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
}
+/*
+ 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
*/
{ "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"},