static void usage(void)
{
- printf("usage: %s: { add-client | del-client } <client-ip>\n", progname);
+ printf("usage: %s { add-client | del-client } <client-ip>\n", progname);
+ printf(" %s sm-notify mon_name ip_addr state\n", progname);
exit(1);
}
+/**
+ * @brief To be used as the statd ha-callout program
+ *
+ * Examples
+ * progname add-client 192.168.10.94 nsds2
+ * progname del-client 192.168.10.94 nsds2
+ * progname sm-notify sitar1 192.168.10.94 127
+ *
+ * @param[in] event One of add-client, del-client, sm-notify
+ * @param[in] mon_name The client being monitored. For add-client, del-client
+ * this will be the IP address. For sm-notify it will
+ * be the hostname
+ * @param[in] other We don't actually use this. For add-client and
+ * del-client it will be NFS server hostname.
+ * For sm-notify, it will be the client's state number.
+ */
int main(int argc, const char *argv[])
{
const char *event = NULL;
case CTDB_SC_MODE_NONE:
break;
}
+ } else if (strcmp(event, "sm-notify") == 0) {
+ exit(0);
} else {
usage();
}
rm -f "${state_dir}/mon@${_sip}@${1}"
done
;;
+ sm-notify)
+ cmd="${CTDB_SCRIPTS_HELPER_BINDIR}/statd_callout"
+ unit_test "$cmd" "$event" "$@"
+ ;;
takeip)
cmd="${CTDB_SCRIPTS_TOOLS_HELPER_DIR}/statd_callout_helper"
script_test "$cmd" "$event" "$@"
--- /dev/null
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "confirm sm-notify is ignored"
+
+setup
+
+ok_null
+simple_test_event "startup"
+simple_test_event "sm-notify" "192.168.10.104" "client10" "9999"