From 1538fc458568c9d5b29125256957f8d6de580d4c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 14 Dec 2015 11:34:41 +1100 Subject: [PATCH] ctdb-tools: Add standalone ctdb_natgw tool script This is intended to replace the use of "ctdb natgwlist" in 11.natgw and provide different views of the NAT gateway status. It replaces the use of CTDB_NATGW_SLAVE_ONLY=yes with a "slave-only" keyword in the NAT gateway nodes file. This means the nodes file must be consistent on all nodes in a NAT gateway group. Note that this script is not yet integrated, so there are no behaviour or documentation changes. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/packaging/RPM/ctdb.spec.in | 1 + ctdb/tools/ctdb_natgw | 199 ++++++++++++++++++++++++++++++++ ctdb/wscript | 7 ++ 3 files changed, 207 insertions(+) create mode 100755 ctdb/tools/ctdb_natgw diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in index 9985dfe61bb..55ce0e5e1be 100644 --- a/ctdb/packaging/RPM/ctdb.spec.in +++ b/ctdb/packaging/RPM/ctdb.spec.in @@ -203,6 +203,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/ltdbtool %{_bindir}/ctdb_diagnostics %{_bindir}/onnode +%{_bindir}/ctdb_natgw %dir %{_libdir} %{_libdir}/ctdb/lib* %{_libdir}/libtevent-unix-util.so.0* diff --git a/ctdb/tools/ctdb_natgw b/ctdb/tools/ctdb_natgw new file mode 100755 index 00000000000..d778c2de4c4 --- /dev/null +++ b/ctdb/tools/ctdb_natgw @@ -0,0 +1,199 @@ +#!/bin/sh + +if [ -z "$CTDB_BASE" ] ; then + export CTDB_BASE="/usr/local/etc/ctdb" +fi + +. "${CTDB_BASE}/functions" +loadconfig "ctdb" + +# Default NAT gateway nodes file location +[ -n "$CTDB_NATGW_NODES" ] || CTDB_NATGW_NODES="${CTDB_BASE}/natgw_nodes" + +[ -n "$CTDB_SOCKET" ] && export CTDB_SOCKET + +############################################################ + +usage () +{ +cat < + +