accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [1/3] git commit: Fixes "hostname -a" errors on OS X
Date Mon, 02 Dec 2013 20:56:16 GMT
Updated Branches:
  refs/heads/master 7c40a171d -> c7062890d


Fixes "hostname -a" errors on OS X


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

Branch: refs/heads/master
Commit: 42e8df7eb0ea5d2d803c229bb0810f9e81ded462
Parents: 07fa748
Author: Michael Allen <michael@sqrrl.com>
Authored: Mon Dec 2 15:20:30 2013 -0500
Committer: John Vines <jvines@gmail.com>
Committed: Mon Dec 2 15:54:44 2013 -0500

----------------------------------------------------------------------
 bin/start-here.sh |  2 +-
 bin/stop-here.sh  | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/42e8df7e/bin/start-here.sh
----------------------------------------------------------------------
diff --git a/bin/start-here.sh b/bin/start-here.sh
index 29f901d..e85f367 100755
--- a/bin/start-here.sh
+++ b/bin/start-here.sh
@@ -40,7 +40,7 @@ if [ $? != 0 ]; then
    ip=$(python -c 'import socket as s; print s.gethostbyname(s.getfqdn())')
 fi
 
-HOSTS="`hostname -a` `hostname` localhost 127.0.0.1 $ip"
+HOSTS="$(hostname -a 2> /dev/null) $(hostname) localhost 127.0.0.1 $ip"
 for host in $HOSTS; do
    if grep -q "^${host}\$" $ACCUMULO_CONF_DIR/slaves; then
       ${bin}/start-server.sh $host tserver "tablet server"

http://git-wip-us.apache.org/repos/asf/accumulo/blob/42e8df7e/bin/stop-here.sh
----------------------------------------------------------------------
diff --git a/bin/stop-here.sh b/bin/stop-here.sh
index d539b68..4d5533a 100755
--- a/bin/stop-here.sh
+++ b/bin/stop-here.sh
@@ -33,10 +33,16 @@ bin="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 
 ACCUMULO="$ACCUMULO_HOME/lib/accumulo-start.jar"
 
+# Determine hostname without errors to user
+HOSTNAME=$(hostname -a 2> /dev/null | head -1)
+if [ -z ${HOSTNAME} ]; then
+   HOSTNAME=$(hostname)
+fi
+
 if egrep -q localhost\|127.0.0.1 $ACCUMULO_CONF_DIR/slaves; then
    $bin/accumulo admin stop localhost
 else
-   for host in "`hostname -a` `hostname`"; do
+   for host in "$(hostname -a 2> /dev/null) $(hostname)"; do
       if grep -q ${host} $ACCUMULO_CONF_DIR/slaves; then
          ${bin}/accumulo admin stop $host
       fi
@@ -47,7 +53,7 @@ for signal in TERM KILL; do
    for svc in tserver gc master monitor logger tracer; do
       PID=$(ps -ef | egrep ${ACCUMULO} | grep "Main $svc" | grep -v grep | grep -v stop-here.sh
| awk '{print $2}' | head -1)
       if [ ! -z $PID ]; then
-         echo "Stopping ${svc} on `hostname -a | head -1` with signal ${signal}"
+         echo "Stopping ${svc} on ${HOSTNAME} with signal ${signal}"
          kill -s ${signal} ${PID}
       fi
    done


Mime
View raw message