accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1295918 - in /incubator/accumulo/branches/1.4/src/packages/deb: accumulo-native/postinst accumulo/postinst
Date Thu, 01 Mar 2012 21:41:02 GMT
Author: vines
Date: Thu Mar  1 21:41:02 2012
New Revision: 1295918

URL: http://svn.apache.org/viewvc?rev=1295918&view=rev
Log:
ACCUMULO-435 - changed them both, they now accept the variable if set, otherwise sets to the
big-top configuration path for hadoop adn ZK. For Java, it follows the symlink around to the
home directory to find JAVA_HOME


Modified:
    incubator/accumulo/branches/1.4/src/packages/deb/accumulo-native/postinst
    incubator/accumulo/branches/1.4/src/packages/deb/accumulo/postinst

Modified: incubator/accumulo/branches/1.4/src/packages/deb/accumulo-native/postinst
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/packages/deb/accumulo-native/postinst?rev=1295918&r1=1295917&r2=1295918&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/packages/deb/accumulo-native/postinst (original)
+++ incubator/accumulo/branches/1.4/src/packages/deb/accumulo-native/postinst Thu Mar  1 21:41:02
2012
@@ -16,11 +16,11 @@
 # limitations under the License.
 
 # postinst script for Apache Accumulo native libraries
-JAVA_HOME=/usr/lib/jvm/default-java
-if [ ! -d $JAVA_HOME ]; then 
-  export JAVA_HOME=/usr/lib/jvm/java-6-openjdk;
+if [ -z $JAVA_HOME ]; then
+  JAVA_HOME=`!readlink -f /usr/bin/java`
+  JAVA_HOME=`dirname $JAVA_HOME`
+  JAVA_HOME=`ci $JAVA_HOME/../../; pwd`
 fi
 export JAVA_HOME
-echo $JAVA_HOME
 cd /usr/lib/accumulo/src/server/src/main/c++
 make

Modified: incubator/accumulo/branches/1.4/src/packages/deb/accumulo/postinst
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/packages/deb/accumulo/postinst?rev=1295918&r1=1295917&r2=1295918&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/packages/deb/accumulo/postinst (original)
+++ incubator/accumulo/branches/1.4/src/packages/deb/accumulo/postinst Thu Mar  1 21:41:02
2012
@@ -26,8 +26,19 @@ mkdir -p /var/log/accumulo/walogs
 ln -fs /var/log/accumulo/logs /usr/lib/accumulo/logs 
 ln -fs /var/log/accumulo/walogs /usr/lib/accumulo/walogs 
 
+if [ -z $JAVA_HOME ]; then
+  JAVA_HOME=`!readlink -f /usr/bin/java`
+  JAVA_HOME=`dirname $JAVA_HOME`
+  JAVA_HOME=`ci $JAVA_HOME/../../; pwd`
+fi
+if [ -z $ZOOKEEPER_HOME ]; then
+  ZOOKEEPER_HOME="/usr/lib/zookeeper"
+fi
+if [ -z $HADOOP_HOME ]; then
+  HADOOP_HOME="/usr/lib/hadoop"
+fi
 for files in `ls /etc/accumulo/conf/accumulo-env.sh.*`; do
-  sed -i -e 's:/path/to/java:/usr/lib/jvm/default-java:' $files 
-  sed -i -e 's:/path/to/zookeeper:/usr/lib/zookeeper:' $files 
-  sed -i -e 's:/path/to/hadoop:/usr/lib/hadoop:' $files 
+  sed -i -e "s:/path/to/java:$JAVA_HOME:" $files 
+  sed -i -e "s:/path/to/zookeeper:$ZOOKEEPER_HOME:" $files 
+  sed -i -e "s:/path/to/hadoop:$HADOOP_HOME:" $files 
 done 



Mime
View raw message