summaryrefslogtreecommitdiff
path: root/ctdb/tools/onnode
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2010-01-21 13:16:18 +1100
committerMartin Schwenke <martin@meltin.net>2010-01-21 13:16:18 +1100
commit14b3c37d9ddf3387bb30e68bd8b1ba08c789070e (patch)
treee2fa0b09737f00060e448a596241d3636e33b82f /ctdb/tools/onnode
parent21e5b4467384682a896cf9e6c0fd2bd028be8bf5 (diff)
downloadsamba-14b3c37d9ddf3387bb30e68bd8b1ba08c789070e.tar.gz
onnode - respect $CTDB_BASE rather than hard-coding /etc/ctdb.
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit a9aa2e06774e8cd59a86d3343d3da2a2769561b5)
Diffstat (limited to 'ctdb/tools/onnode')
-rwxr-xr-xctdb/tools/onnode8
1 files changed, 5 insertions, 3 deletions
diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode
index 7c0a86eb9d1..c44b89ad5d2 100755
--- a/ctdb/tools/onnode
+++ b/ctdb/tools/onnode
@@ -63,6 +63,8 @@ quiet=false
prefix=""
names_ok=false
+ctdb_base="${CTDB_BASE:-/etc/ctdb}"
+
parse_options ()
{
# $POSIXLY_CORRECT means that the command passed to onnode can
@@ -165,7 +167,7 @@ get_nodes_with_status ()
# Succeeded. Get address. NOTE: this is an optimisation.
# It might be better to get the node number and then get
# the nth node to get the address. This would make things
- # more consistent if /etc/ctdb/nodes actually contained
+ # more consistent if $ctdb_base/nodes actually contained
# hostnames.
nodes="${nodes} ${t##*:}"
fi
@@ -229,7 +231,7 @@ get_nodes ()
if [ -n "$CTDB_NODES_SOCKETS" ] ; then
all_nodes="$CTDB_NODES_SOCKETS"
else
- [ -e "$CTDB_NODES_FILE" ] || CTDB_NODES_FILE=/etc/ctdb/nodes
+ [ -e "$CTDB_NODES_FILE" ] || CTDB_NODES_FILE="${ctdb_base}/nodes"
all_nodes=$(sed -e 's@#.*@@g' -e 's@ *@@g' -e 's@^$@#DEAD@' $CTDB_NODES_FILE)
fi
@@ -305,7 +307,7 @@ if [ -n "$CTDB_NODES_SOCKETS" ] ; then
SSH=fakessh
else
# Could "2>/dev/null || true" but want to see errors from typos in file.
- [ -r /etc/ctdb/onnode.conf ] && . /etc/ctdb/onnode.conf
+ [ -r "${ctdb_base}/onnode.conf" ] && . "${ctdb_base}/onnode.conf"
[ -n "$SSH" ] || SSH=ssh
if [ "$SSH" = "ssh" ] ; then
ssh_opts="-n"