diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-06-02 15:03:44 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-06-02 15:03:44 +1000 |
commit | 45aa5420649c9b7fbe578de8caf358d71f6397c1 (patch) | |
tree | 60692ce8ea3cbd8188ca94e03105b457fc158cd2 /ctdb/tools | |
parent | f49c71fa4f3e1952494ded6484b2b05c19fadfb9 (diff) | |
download | samba-45aa5420649c9b7fbe578de8caf358d71f6397c1.tar.gz samba-45aa5420649c9b7fbe578de8caf358d71f6397c1.tar.xz samba-45aa5420649c9b7fbe578de8caf358d71f6397c1.zip |
teach ONNODE about deleted nodes
(This used to be ctdb commit 03d304e72a5839dc8d8d2e2312b346c21dca5774)
Diffstat (limited to 'ctdb/tools')
-rwxr-xr-x | ctdb/tools/onnode | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode index d7adbb05af..aae7770653 100755 --- a/ctdb/tools/onnode +++ b/ctdb/tools/onnode @@ -95,7 +95,7 @@ echo_nth () shift $n local node="$1" - if [ -n "$node" ] ; then + if [ -n "$node" -a "$node" != "#DEAD" ] ; then echo $node else echo "${prog}: \"node ${n}\" does not exist" >&2 @@ -206,7 +206,7 @@ get_nodes () all_nodes="$CTDB_NODES_SOCKETS" else [ -f "$CTDB_NODES_FILE" ] || CTDB_NODES_FILE=/etc/ctdb/nodes - all_nodes=$(egrep '^[[:alnum:]]' $CTDB_NODES_FILE) + all_nodes=$(sed -e 's@#.*@@g' -e 's@ *@@g' -e 's@^$@#DEAD@' $CTDB_NODES_FILE) fi local nodes="" @@ -215,7 +215,8 @@ get_nodes () [ $? != 0 ] && exit 1 # Required to catch exit in above subshell. case "$n" in all) - echo $all_nodes ;; + echo "${all_nodes//#DEAD/}" + ;; ok|healthy) get_nodes_with_status "$all_nodes" "healthy" || exit 1 ;; |