accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1439675 - in /accumulo/trunk/bin: start-here.sh stop-here.sh
Date Mon, 28 Jan 2013 22:30:24 GMT
Author: vines
Date: Mon Jan 28 22:30:24 2013
New Revision: 1439675

URL: http://svn.apache.org/viewvc?rev=1439675&view=rev
Log:
ACCUMULO-944 - start-here now considers IPs, including 127.0.0.1. So does stop-here


Modified:
    accumulo/trunk/bin/start-here.sh
    accumulo/trunk/bin/stop-here.sh

Modified: accumulo/trunk/bin/start-here.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/bin/start-here.sh?rev=1439675&r1=1439674&r2=1439675&view=diff
==============================================================================
--- accumulo/trunk/bin/start-here.sh (original)
+++ accumulo/trunk/bin/start-here.sh Mon Jan 28 22:30:24 2013
@@ -24,7 +24,18 @@ bin=`cd "$bin"; pwd`
 
 . "$bin"/config.sh
 
-HOSTS="`hostname -a` `hostname` localhost"
+IFCONFIG=/sbin/ifconfig
+if [ ! -x $IFCONFIG ]
+then
+   IFCONFIG='/bin/netstat -ie'
+fi
+ip=`$IFCONFIG 2>/dev/null| grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v
0.0.0.0 | grep -v 127.0.0.1 | head -n 1`
+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"
 for host in $HOSTS
 do
     if grep -q "^${host}\$" $ACCUMULO_HOME/conf/slaves

Modified: accumulo/trunk/bin/stop-here.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/bin/stop-here.sh?rev=1439675&r1=1439674&r2=1439675&view=diff
==============================================================================
--- accumulo/trunk/bin/stop-here.sh (original)
+++ accumulo/trunk/bin/stop-here.sh Mon Jan 28 22:30:24 2013
@@ -26,7 +26,7 @@ bin=`cd "$bin"; pwd`
 
 ACCUMULO="$ACCUMULO_HOME/.*/accumulo-start.*.jar"
 
-if grep -q localhost $ACCUMULO_HOME/conf/slaves
+if egrep -q localhost\|127.0.0.1 $ACCUMULO_HOME/conf/slaves
 then
     $bin/accumulo admin stop localhost
 else



Mime
View raw message