ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject git commit: Argus 148:Ranger Hive Plugin to update conf.server for Hive to support Ambari Installation
Date Sun, 02 Nov 2014 06:33:30 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/ranger-0.4 dc8b8e072 -> 42916ca66


Argus 148:Ranger Hive Plugin to update conf.server for Hive to support
Ambari Installation


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

Branch: refs/heads/ranger-0.4
Commit: 42916ca6686d0488d9bcff9d0f892107948e9ae4
Parents: dc8b8e0
Author: rmani <rmani@hortonworks.com>
Authored: Sat Nov 1 23:10:42 2014 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Sat Nov 1 23:31:04 2014 -0700

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/42916ca6/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index 37ee161..d2f7792 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -140,6 +140,16 @@ then
 	exit 1
 fi
 
+ambari_hive_install="N"
+if  [ "${HCOMPONENT_NAME}" = "hive" ]
+then
+	HCOMPONENT_CONF_SERVER_DIR="${HCOMPONENT_CONF_DIR}"/../conf.server
+	if [ -d "${HCOMPONENT_CONF_SERVER_DIR}" ]
+	then 
+		ambari_hive_install="Y"
+	fi
+fi
+
 #
 # Common functions used by all enable/disable scripts
 #
@@ -348,6 +358,22 @@ then
                     then
                     	cat ${newfn} > ${fullpathorgfn}
                     fi
+                    
+                    # For Ambari install copy the .xml to conf.server also
+					if [ "${ambari_hive_install}" = "Y" ]
+					then
+					    fullpathorgHS2fn="${HCOMPONENT_CONF_SERVER_DIR}/${orgfn}"
+					    archiveHS2fn="${HCOMPONENT_CONF_SERVER_DIR}/.${orgfn}.${dt}"
+        				newHS2fn="${HCOMPONENT_CONF_SERVER_DIR}/.${orgfn}-new.${dt}"
+						log "Saving current conf.server file: ${fullpathorgHS2fn} to ${archiveHS2fn} ..."
+						if [ -f ${fullpathorgHS2fn} ]
+						then 
+            				cp ${fullpathorgHS2fn} ${archiveHS2fn}
+            			fi
+						cp ${fullpathorgfn} ${HCOMPONENT_CONF_SERVER_DIR}/${orgfn}
+						chown ${CFG_OWNER_INF} ${HCOMPONENT_CONF_SERVER_DIR}/${orgfn}
+					fi
+					
                	else
 				    echo "ERROR: Unable to make changes to config. file: ${fullpathorgfn}"
                     echo "exiting ...."


Mime
View raw message