accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-4403 Use FQDN and all hostname aliases
Date Sun, 14 Aug 2016 03:03:36 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.8 7dc726e07 -> 09c38326f
  refs/heads/master 795487392 -> 62ba8ef8c


ACCUMULO-4403 Use FQDN and all hostname aliases

If there are multiple aliases for a host, stop-here.sh would
fail to handle them. Also, fix some related shellcheck
warnings in the same file.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/09c38326
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/09c38326
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/09c38326

Branch: refs/heads/1.8
Commit: 09c38326f6f4732afad0c0779b1fc0e242bf4ce3
Parents: 7dc726e
Author: Josh Elser <elserj@apache.org>
Authored: Sat Aug 13 23:01:15 2016 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Sat Aug 13 23:01:15 2016 -0400

----------------------------------------------------------------------
 assemble/bin/stop-here.sh | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/09c38326/assemble/bin/stop-here.sh
----------------------------------------------------------------------
diff --git a/assemble/bin/stop-here.sh b/assemble/bin/stop-here.sh
index 6f0aa7f..a9973f4 100755
--- a/assemble/bin/stop-here.sh
+++ b/assemble/bin/stop-here.sh
@@ -31,24 +31,23 @@ bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 
 . "$bin"/config.sh
 
-ACCUMULO="$ACCUMULO_HOME/lib/accumulo-start.jar"
-
 # Determine hostname without errors to user
-HOSTNAME=$(hostname -a 2> /dev/null | head -1)
-[[ -z ${HOSTNAME} ]] && HOSTNAME=$(hostname)
+HOSTS_TO_CHECK=($(hostname -a 2> /dev/null | head -1) $(hostname -f))
 
 if egrep -q localhost\|127.0.0.1 "$ACCUMULO_CONF_DIR/slaves"; then
    "$bin/accumulo" admin stop localhost
 else
-   for host in "$(hostname -a 2> /dev/null)" "$(hostname)"; do
-      if grep -q ${host} $ACCUMULO_CONF_DIR/slaves; then
+   for host in "${HOSTS_TO_CHECK[@]}"; do
+      if grep -q "$host" "$ACCUMULO_CONF_DIR"/slaves; then
          "${bin}/accumulo" admin stop "$host"
       fi
    done
 fi
 
-for signal in TERM KILL; do
-   for svc in tserver gc master monitor tracer; do
-      $ACCUMULO_HOME/bin/stop-server.sh $HOSTNAME "$ACCUMULO_HOME/lib/accumulo-start.jar"
$svc $signal
+for HOSTNAME in "${HOSTS_TO_CHECK[@]}"; do
+   for signal in TERM KILL; do
+      for svc in tserver gc master monitor tracer; do
+         "$ACCUMULO_HOME"/bin/stop-server.sh "$HOSTNAME" "$ACCUMULO_HOME/lib/accumulo-start.jar"
$svc $signal
+      done
    done
 done


Mime
View raw message