ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-161:Ranger install scripts should refer JAVA_HOME for java
Date Thu, 06 Nov 2014 04:57:41 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 4d66a5240 -> 666f96775


ARGUS-161:Ranger install scripts should refer JAVA_HOME for java

Signed-off-by: sneethiraj <sneethir@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/666f9677
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/666f9677
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/666f9677

Branch: refs/heads/master
Commit: 666f96775bafe824e64732be2bc4e18140431337
Parents: 4d66a52
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Wed Nov 5 23:34:39 2014 -0500
Committer: sneethiraj <sneethir@apache.org>
Committed: Wed Nov 5 23:56:42 2014 -0500

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 11 +++++++++--
 security-admin/scripts/setup.sh       | 27 +++++++++++++++------------
 unixauthservice/scripts/setup.sh      |  2 +-
 3 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/666f9677/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index d2f7792..c976959 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -33,6 +33,13 @@ then
     exit 1
 fi
 
+#Check for JAVA_HOME
+if [ "${JAVA_HOME}" == "" ]
+then
+    echo "ERROR: JAVA_HOME environment property not defined, aborting installation."
+    exit 1
+fi
+
 #
 # Identify the component, action from the script file
 #
@@ -94,7 +101,7 @@ DEFAULT_XML_CONFIG=${PROJ_INSTALL_DIR}/install/conf.templates/default/configurat
 PROJ_LIB_DIR=${PROJ_INSTALL_DIR}/lib
 PROJ_INSTALL_LIB_DIR="${PROJ_INSTALL_DIR}/install/lib"
 INSTALL_ARGS="${PROJ_INSTALL_DIR}/install.properties"
-JAVA=java
+JAVA=$JAVA_HOME/bin/java
 
 hdir=${PROJ_INSTALL_DIR}/../${HCOMPONENT_NAME}
 
@@ -176,7 +183,7 @@ create_jceks() {
 
 	tempFile=/tmp/jce.$$.out
 
-    java -cp ":${PROJ_INSTALL_LIB_DIR}/*:" com.hortonworks.credentialapi.buildks create "${alias}"
-value "${pass}" -provider "jceks://file${jceksFile}" > ${tempFile} 2>&1
+    $JAVA_HOME/bin/java -cp ":${PROJ_INSTALL_LIB_DIR}/*:" com.hortonworks.credentialapi.buildks
create "${alias}" -value "${pass}" -provider "jceks://file${jceksFile}" > ${tempFile} 2>&1
 
 	if [ $? -ne 0 ]
 	then

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/666f9677/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index a81a5f8..dc5dbd3 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -192,11 +192,20 @@ check_db_connector() {
     fi
 }
 check_java_version() {
+	#Check for JAVA_HOME
+	if [ "${JAVA_HOME}" == "" ]
+	then
+		log "[E] JAVA_HOME environment property not defined, aborting installation."
+		exit 1
+	fi
+
+        export JAVA_BIN=${JAVA_HOME}/bin/java
+
 	if is_command ${JAVA_BIN} ; then
 		log "[I] '${JAVA_BIN}' command found"
 	else
-		log "[E] '${JAVA_BIN}' command not found"
-		exit 1;
+               log "[E] '${JAVA_BIN}' command not found"
+               exit 1;
 	fi
 
 	$JAVA_BIN -version 2>&1 | grep -q $JAVA_VERSION_REQUIRED
@@ -205,12 +214,6 @@ check_java_version() {
 		exit 1;
 	fi
 
-	#Check for JAVA_HOME
-	if [ "${JAVA_HOME}" == "" ]
-	then
-		log "[E] JAVA_HOME environment property not defined, aborting installation."
-		exit 1
-	fi
 
 	#$JAVA_BIN -version 2>&1 | grep -q "$JAVA_ORACLE"
 	#if [ $? != 0 ] ; then
@@ -789,7 +792,7 @@ update_properties() {
 	then
 		mkdir -p `dirname "${keystore}"`
 
-		java -cp "cred/lib/*" com.hortonworks.credentialapi.buildks create "$db_password_alias"
-value "$db_password" -provider jceks://file$keystore
+		$JAVA_HOME/bin/java -cp "cred/lib/*" com.hortonworks.credentialapi.buildks create "$db_password_alias"
-value "$db_password" -provider jceks://file$keystore
 
 		propertyName=xaDB.jdbc.credential.alias
 		newPropertyValue="${db_password_alias}"
@@ -826,7 +829,7 @@ update_properties() {
 
 	if [ "${keystore}" != "" ]
 	then
-		java -cp "cred/lib/*" com.hortonworks.credentialapi.buildks create "$audit_db_password_alias"
-value "$audit_db_password" -provider jceks://file$keystore
+		$JAVA_HOME/bin/java -cp "cred/lib/*" com.hortonworks.credentialapi.buildks create "$audit_db_password_alias"
-value "$audit_db_password" -provider jceks://file$keystore
 
 		propertyName=auditDB.jdbc.credential.alias
 		newPropertyValue="${audit_db_password_alias}"
@@ -1249,7 +1252,7 @@ execute_java_patches(){
 					if [ ${c} -eq 0 ]
 					then
 						log "[I] patch ${javaPatch} is being applied..";
-						msg=`java -cp "$app_home/WEB-INF/classes/conf:$app_home/WEB-INF/classes/lib/*:$app_home/WEB-INF/:$app_home/META-INF/:$app_home/WEB-INF/lib/*:$app_home/WEB-INF/classes/:$app_home/WEB-INF/classes/META-INF/"
com.xasecure.patch.${className}`
+						msg=`$JAVA_HOME/bin/java -cp "$app_home/WEB-INF/classes/conf:$app_home/WEB-INF/classes/lib/*:$app_home/WEB-INF/:$app_home/META-INF/:$app_home/WEB-INF/lib/*:$app_home/WEB-INF/classes/:$app_home/WEB-INF/classes/META-INF/"
com.xasecure.patch.${className}`
 						check_ret_status $? "Unable to apply patch:$javaPatch. $msg"
 						touch ${tempFile}
 						echo >> ${tempFile}
@@ -1282,7 +1285,7 @@ execute_java_patches(){
 					if test "${result2#*$version}" == "$result2"
 					then
 						log "[I] patch ${javaPatch} is being applied..";
-						msg=`java -cp "$app_home/WEB-INF/classes/conf:$app_home/WEB-INF/classes/lib/*:$app_home/WEB-INF/:$app_home/META-INF/:$app_home/WEB-INF/lib/*:$app_home/WEB-INF/classes/:$app_home/WEB-INF/classes/META-INF/"
com.xasecure.patch.${className}`
+						msg=`$JAVA_HOME/bin/java -cp "$app_home/WEB-INF/classes/conf:$app_home/WEB-INF/classes/lib/*:$app_home/WEB-INF/:$app_home/META-INF/:$app_home/WEB-INF/lib/*:$app_home/WEB-INF/classes/:$app_home/WEB-INF/classes/META-INF/"
com.xasecure.patch.${className}`
 						check_ret_status $? "Unable to apply patch:$javaPatch. $msg"
 						touch ${tempFile}
 						echo >> ${tempFile}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/666f9677/unixauthservice/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/setup.sh b/unixauthservice/scripts/setup.sh
index beeccc7..aed42b7 100755
--- a/unixauthservice/scripts/setup.sh
+++ b/unixauthservice/scripts/setup.sh
@@ -216,7 +216,7 @@ then
     echo "Storing ldap bind password in credential store"
 	mkdir -p `dirname "${SYNC_LDAP_BIND_KEYSTOREPATH}"`
 	chown ${unix_user}:${unix_group} `dirname "${SYNC_LDAP_BIND_KEYSTOREPATH}"`
-	java -cp "./lib/*" com.hortonworks.credentialapi.buildks create $SYNC_LDAP_BIND_ALIAS -value
$SYNC_LDAP_BIND_PASSWORD -provider jceks://file$SYNC_LDAP_BIND_KEYSTOREPATH
+	$JAVA_HOME/bin/java -cp "./lib/*" com.hortonworks.credentialapi.buildks create $SYNC_LDAP_BIND_ALIAS
-value $SYNC_LDAP_BIND_PASSWORD -provider jceks://file$SYNC_LDAP_BIND_KEYSTOREPATH
     SYNC_LDAP_BIND_PASSWORD="_"
   fi
 


Mime
View raw message