You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2014/10/31 21:10:56 UTC

git commit: ARGUS-137 Argus rename and repackaging changes

Repository: incubator-argus
Updated Branches:
  refs/heads/argus2ranger 6a923848d -> eca811d21


ARGUS-137 Argus rename and repackaging changes

Signed-off-by: sneethiraj <sn...@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/eca811d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/eca811d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/eca811d2

Branch: refs/heads/argus2ranger
Commit: eca811d2137055efce9d512b96fc55f4561a0025
Parents: 6a92384
Author: Gautam Borad <gb...@hortonworks.com>
Authored: Fri Oct 31 19:08:18 2014 +0530
Committer: sneethiraj <sn...@apache.org>
Committed: Fri Oct 31 11:58:39 2014 -0700

----------------------------------------------------------------------
 security-admin/src/bin/ranger_install.py        | 80 +++++++++--------
 security-admin/src/bin/ranger_usersync.py       | 17 ++++
 security-admin/src/bin/service_start.py         |  7 +-
 winpkg/src/template/bin/hiveserver2-argus.cmd   | 91 --------------------
 winpkg/src/template/bin/hiveserver2-ranger.cmd  | 91 ++++++++++++++++++++
 winpkg/src/template/bin/xasecure-hadoop-env.cmd | 12 ++-
 6 files changed, 163 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/security-admin/src/bin/ranger_install.py
----------------------------------------------------------------------
diff --git a/security-admin/src/bin/ranger_install.py b/security-admin/src/bin/ranger_install.py
index 3fe3407..6b1e324 100644
--- a/security-admin/src/bin/ranger_install.py
+++ b/security-admin/src/bin/ranger_install.py
@@ -184,8 +184,9 @@ def get_jdk_options():
 def get_ranger_classpath():
     global conf_dict
     EWS_ROOT = conf_dict['EWS_ROOT']
+    WEBAPP_ROOT = conf_dict['WEBAPP_ROOT']
 
-    cp = [ os.path.join(EWS_ROOT,"lib","*"), EWS_ROOT, os.path.join(os.getenv('JAVA_HOME'), 'lib', '*')]
+    cp = [ os.path.join(WEBAPP_ROOT, "WEB-INF", "classes", "conf"), os.path.join(EWS_ROOT,"lib","*"), EWS_ROOT, os.path.join(os.getenv('JAVA_HOME'), 'lib', '*')]
     class_path = get_class_path(cp)
     return class_path
 
@@ -245,14 +246,15 @@ def init_variables(switch):
         populate_config_dict_from_env()
     else:
         populate_config_dict_from_file()
-    INSTALL_DIR = os.path.join(conf_dict['RANGER_ADMIN_HOME'] , "app")
+    #INSTALL_DIR = os.path.join(conf_dict['RANGER_ADMIN_HOME'] , "app")
+    INSTALL_DIR = conf_dict['RANGER_ADMIN_HOME']
     EWS_ROOT    = os.path.join(INSTALL_DIR , "ews")
     WEBAPP_ROOT = os.path.join(INSTALL_DIR , "ews" , "webapp")
 
-    if switch == "service":
-        war_file_path = os.path.join(conf_dict['RANGER_ADMIN_HOME'] , "war", "security-admin-web-*.war")
-        war_file_list = glob.glob(war_file_path)
-        conf_dict['war_file']   = war_file_list[0]
+    #if switch == "service":
+    #    war_file_path = os.path.join(conf_dict['RANGER_ADMIN_HOME'] , "war", "security-admin-web-*.war")
+    #    war_file_list = glob.glob(war_file_path)
+    #    conf_dict['war_file']   = war_file_list[0]
 
     conf_dict['EWS_ROOT']   = EWS_ROOT
     conf_dict['WEBAPP_ROOT']= WEBAPP_ROOT
@@ -295,6 +297,10 @@ def setup_install_files():
         log("creating WEBAPP dir : " + WEBAPP_ROOT, "debug")
         os.makedirs(WEBAPP_ROOT)
 
+    if not os.path.isdir(os.path.join(WEBAPP_ROOT,"WEB-INF","classes","conf")):
+        log("creating conf dir : " + WEBAPP_ROOT, "debug")
+        os.makedirs(os.path.join(WEBAPP_ROOT,"WEB-INF","classes","conf"))
+
     if not os.path.isdir(EWS_LIB_DIR):
         log("creating EWS_LIB_DIR dir : " + EWS_LIB_DIR, "debug")
         os.makedirs(EWS_LIB_DIR)
@@ -303,12 +309,14 @@ def setup_install_files():
     #    log("creating EWS_LOG_DIR dir : " + EWS_LOG_DIR, "debug")
     #    os.makedirs(EWS_LOG_DIR)
 
-    log("copying libraries ", "debug")
-    copy_files(os.path.join(RANGER_ADMIN_HOME,"ews","lib"), EWS_LIB_DIR)
+    #log("copying libraries ", "debug")
+    #copy_files(os.path.join(RANGER_ADMIN_HOME,"ews","lib"), EWS_LIB_DIR)
 
-    log("copying xapolicymgr.properties file", "debug")
-    shutil.copyfile(os.path.join(RANGER_ADMIN_HOME,"ews","xapolicymgr.properties"), os.path.join(EWS_ROOT,"xapolicymgr.properties"))
+    #log("copying xapolicymgr.properties file", "debug")
+    #shutil.copyfile(os.path.join(RANGER_ADMIN_HOME,"ews","xapolicymgr.properties"), os.path.join(EWS_ROOT,"xapolicymgr.properties"))
 
+    log("copying conf.dist/ to conf/", "debug")
+    copy_files(os.path.join(WEBAPP_ROOT,"WEB-INF","classes","conf.dist"), os.path.join(WEBAPP_ROOT,"WEB-INF","classes","conf"))
     log(" Setting up installation files and directory DONE", "info");
 pass
 
@@ -595,22 +603,22 @@ def import_db ():
             log("\nImport asset sql file not found\n","exception")
             sys.exit(1)
 
-def extract_war():
-    global conf_dict
-    war_file = conf_dict['war_file']
-    WEBAPP_ROOT = conf_dict['WEBAPP_ROOT']
-
-    if os.path.isfile(war_file):
-        log("Extract War file " + war_file + " to " + WEBAPP_ROOT,"info")
-    else:
-        log(war_file + " file not found!","exception")
-
-    if os.path.isdir(WEBAPP_ROOT):
-        with zipfile.ZipFile(war_file, "r") as z:
-            z.extractall(WEBAPP_ROOT)
-        log("Extract War file " + war_file + " to " + WEBAPP_ROOT + " DONE! ","info")
-        if os.path.isfile ( os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml.prod")) :
-            shutil.copyfile(os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml.prod"), os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml"))
+#def extract_war():
+#    global conf_dict
+#    war_file = conf_dict['war_file']
+#    WEBAPP_ROOT = conf_dict['WEBAPP_ROOT']
+#
+#    if os.path.isfile(war_file):
+#        log("Extract War file " + war_file + " to " + WEBAPP_ROOT,"info")
+#    else:
+#        log(war_file + " file not found!","exception")
+#
+#    if os.path.isdir(WEBAPP_ROOT):
+#        with zipfile.ZipFile(war_file, "r") as z:
+#            z.extractall(WEBAPP_ROOT)
+#        log("Extract War file " + war_file + " to " + WEBAPP_ROOT + " DONE! ","info")
+#        if os.path.isfile ( os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml.prod")) :
+#            shutil.copyfile(os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml.prod"), os.path.join(WEBAPP_ROOT, "WEB-INF", "log4j.xml"))
 
 # def copy_mysql_connector():
 #     log("Copying MYSQL Connector to "+app_home+"/WEB-INF/lib ","info")
@@ -635,11 +643,9 @@ pass
 
 def update_xapolicymgr_properties():
     global conf_dict
-    EWS_ROOT = conf_dict['EWS_ROOT']
     WEBAPP_ROOT = conf_dict['WEBAPP_ROOT']
-    xapolicymgr_properties = os.path.join(EWS_ROOT, "xapolicymgr.properties")
+    xapolicymgr_properties = os.path.join(WEBAPP_ROOT, "WEB-INF", "classes", "conf", "ranger_webserver.properties")
     log("xapolicymgr_properties: " + xapolicymgr_properties, "debug")
-    to_file = os.path.join(WEBAPP_ROOT, "WEB-INF", "classes", "xa_system.properties")
     ModConfig(xapolicymgr_properties,"xa.webapp.dir", WEBAPP_ROOT.replace('\\','/' ))
 
 
@@ -660,7 +666,7 @@ def update_properties():
     update_xapolicymgr_properties()
 
     newPropertyValue=''
-    to_file = os.path.join(WEBAPP_ROOT, "WEB-INF", "classes", "xa_system.properties")
+    to_file = os.path.join(WEBAPP_ROOT, "WEB-INF", "classes", "conf", "xa_system.properties")
 
     if os.path.isfile(to_file):
         log("to_file: " + to_file + " file found", "info")
@@ -771,7 +777,7 @@ def setup_authentication(authentication_method, xmlPath):
 
        log("Setting up "+authentication_method+" authentication for : " + xmlPath,"debug")
 
-       appContextPath = os.path.join(xmlPath ,"META-INF","security-applicationContext.xml")
+       appContextPath = os.path.join(xmlPath, "WEB-INF", "classes", "conf", "security-applicationContext.xml")
        beanSettingPath = os.path.join(xmlPath, "META-INF","contextXML","ldap_bean_settings.xml")
        secSettingPath = os.path.join(xmlPath , "META-INF","contextXML","ldap_security_settings.xml")
        ## Logic is to find LDAP_BEAN_SETTINGS_START,LDAP_SEC_SETTINGS_START  from appContext xml file and append
@@ -798,7 +804,7 @@ def setup_authentication(authentication_method, xmlPath):
 
    elif authentication_method == "ACTIVE_DIRECTORY":
        log("Setting up "+authentication_method+" authentication for : " + xmlPath,"debug")
-       appContextPath = os.path.join(xmlPath , "META-INF","security-applicationContext.xml")
+       appContextPath = os.path.join(xmlPath, "WEB-INF", "classes", "conf", "security-applicationContext.xml")
        beanSettingPath = os.path.join(xmlPath , "META-INF","contextXML","ad_bean_settings.xml")
        secSettingPath = os.path.join(xmlPath , "META-INF","contextXML","ad_security_settings.xml")
 
@@ -832,12 +838,12 @@ def do_authentication_setup():
    global conf_dict
    webappRoot = conf_dict['WEBAPP_ROOT']
    sys_conf_dict={}
-   log("Starting setup based on user authentication method=authentication_method","debug")
 #    ##Written new function to perform authentication setup for all  cases
    authentication_method = conf_dict['RANGER_AUTHENTICATION_METHOD']
+   log("Starting setup based on user authentication method = " + authentication_method,"debug")
    setup_authentication(authentication_method, webappRoot)
    # ldap_file=  os.path.join(webappRoot ,"WEB-INF","resources","xa_ldap.properties")
-   ldap_file=  os.path.join(webappRoot ,"WEB-INF","classes","xa_ldap.properties")
+   ldap_file=  os.path.join(webappRoot, "WEB-INF", "classes", "conf", "xa_ldap.properties")
    if os.path.isfile(ldap_file):
        log(ldap_file + " file found", "info")
    else:
@@ -896,7 +902,7 @@ def do_authentication_setup():
    if authentication_method == "ACTIVE_DIRECTORY":
        log("[I] Loading ACTIVE DIRECTORY attributes and properties", "debug")
        newPropertyValue=''
-       ldap_file= os.path.join(webappRoot,"WEB-INF","classes","xa_ldap.properties")
+       ldap_file= os.path.join(webappRoot, "WEB-INF", "classes", "conf", "xa_ldap.properties")
        if os.path.isfile(ldap_file):
            log("LDAP file : "+ ldap_file + " file found", "info")
            propertyName="xa_ldap_ad_url"
@@ -1031,14 +1037,14 @@ def call_keystore(libpath,aliasKey,aliasValue , filepath,getorcreate):
 
 
 # Entry point to script using --service
-def run_setup(cmd, app_type):
+def run_setup(cmd):
     init_logfiles()
     log("--------- Running Ranger PolicyManager Install Script ---------","debug")
     #parse_config_file()
     init_variables("service")
     setup_install_files()
     write_config_to_file()
-    extract_war()
+    #extract_war()
     update_properties()
     do_authentication_setup()
     return

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/security-admin/src/bin/ranger_usersync.py
----------------------------------------------------------------------
diff --git a/security-admin/src/bin/ranger_usersync.py b/security-admin/src/bin/ranger_usersync.py
index 2682d36..dcf50ef 100644
--- a/security-admin/src/bin/ranger_usersync.py
+++ b/security-admin/src/bin/ranger_usersync.py
@@ -14,10 +14,13 @@
 
 import sys
 import os
+import logging
 import subprocess
 import time
 #import ranger_install
 from xml.dom.minidom import getDOMImplementation
+import shutil
+import commands
 import re
 
 cmd = sys.argv[0]
@@ -39,6 +42,17 @@ def log(msg,type):
     if type == 'exception':
         logging.exception(" %s",msg)
 
+def copy_files(source_dir,dest_dir):
+    for dir_path, dir_names, file_names in os.walk(source_dir):
+        for file_name in file_names:
+            target_dir = dir_path.replace(source_dir, dest_dir, 1)
+            if not os.path.exists(target_dir):
+                os.mkdir(target_dir)
+            src_file = os.path.join(dir_path, file_name)
+            dest_file = os.path.join(target_dir, file_name)
+            shutil.copyfile(src_file, dest_file)
+
+
 
 def appendTextElement(name, value):
 	elem = xmlDoc.createElement(name)
@@ -62,6 +76,9 @@ def init_variables():
 	conf_dict["RANGER_ADMIN_HOME"] = os.getenv("RANGER_ADMIN_HOME")
 	conf_dict["RANGER_USERSYNC_HOME"] = os.getenv("RANGER_USERSYNC_HOME")
 	conf_dict["INSTALL_DIR"] = os.getenv("RANGER_USERSYNC_HOME")
+        USERSYNC_HOME = conf_dict['RANGER_USERSYNC_HOME']
+	copy_files(os.path.join(USERSYNC_HOME,"conf.dist"), os.path.join(USERSYNC_HOME,"conf"))
+        pass
 
 def get_class_path(paths):
     separator = ';' if sys.platform == 'win32' else ':';

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/security-admin/src/bin/service_start.py
----------------------------------------------------------------------
diff --git a/security-admin/src/bin/service_start.py b/security-admin/src/bin/service_start.py
index 0a365e4..446bc54 100644
--- a/security-admin/src/bin/service_start.py
+++ b/security-admin/src/bin/service_start.py
@@ -20,7 +20,7 @@ import ranger_install
 import re
 
 cmd = sys.argv[0]
-app_type = sys.argv[1]
+app_type = 'ranger-admin'
 
 
 service_entry = '--service' in sys.argv
@@ -29,7 +29,7 @@ configure_entry = '--configure' in sys.argv
 
 if service_entry:
 	try:
-		ranger_install.run_setup(cmd, app_type)
+		ranger_install.run_setup(cmd)
 		jdk_options = ranger_install.get_jdk_options()
 		class_path = ranger_install.get_ranger_classpath()
 		java_class = 'com.xasecure.server.tomcat.EmbededServer'
@@ -61,7 +61,8 @@ if service_entry:
 
 		print prettyXml
 	except:
-		sys.exit()
+		print "######################## Ranger Setup failed! #######################"
+		sys.exit(1)
 
 
 if configure_entry:

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/winpkg/src/template/bin/hiveserver2-argus.cmd
----------------------------------------------------------------------
diff --git a/winpkg/src/template/bin/hiveserver2-argus.cmd b/winpkg/src/template/bin/hiveserver2-argus.cmd
deleted file mode 100644
index 3ed65df..0000000
--- a/winpkg/src/template/bin/hiveserver2-argus.cmd
+++ /dev/null
@@ -1,91 +0,0 @@
-@echo off
-@rem Licensed to the Apache Software Foundation (ASF) under one or more
-@rem contributor license agreements.  See the NOTICE file distributed with
-@rem this work for additional information regarding copyright ownership.
-@rem The ASF licenses this file to You under the Apache License, Version 2.0
-@rem (the "License"); you may not use this file except in compliance with
-@rem the License.  You may obtain a copy of the License at
-@rem
-@rem     http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-set CLASS=org.apache.hive.service.server.HiveServer2
-pushd %HIVE_LIB%
-for /f %%a IN ('dir /b hive-service-*.jar') do (
-  set JAR=%HIVE_LIB%\%%a
-)
-popd
-
-if defined HBASE_HOME (
-	dir %HBASE_HOME%\lib > nul
-	if %errorlevel%==0 (
-		pushd %HBASE_HOME%\lib
-		set HIVE_HBASE_PATH=
-		for /f %%a IN ('dir /b hbase-server-**-hadoop2.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-		for /f %%a IN ('dir /b hbase-client-**-hadoop2.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-		for /f %%a IN ('dir /b hbase-protocol-**-hadoop2.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-		for /f %%a IN ('dir /b htrace-core-**.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-		for /f %%a IN ('dir /b hbase-common-**-hadoop2.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-		for /f %%a IN ('dir /b hbase-hadoop-compat-**-hadoop2.jar') do (
-		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
-		)
-    )
-    popd
-	if defined HBASE_CONF_DIR (
-		dir %HBASE_CONF_DIR% > nul
-		if %errorlevel%==0 (
-			call :AddToHiveHbasePath  %HBASE_CONF_DIR%
-		)
-	)
-  )
-)
-
-if [%1]==[hiveserver2_help] goto :hiveserver2_help
-
-if [%1]==[hiveserver2_catservice] goto :hiveserver2_catservice
-
-:hiveserver2
-  echo "Starting Hive Thrift Server"
-
-  @rem hadoop 20 or newer - skip the aux_jars option and hiveconf
-  call %HIVE_BIN_PATH%\ext\util\execHiveCmd.cmd %CLASS%
-goto :EOF
-
-:hiveserver2_help
-  set HIVEARGS=-h
-  goto :hiveserver2
-goto :EOF
-
-:hiveserver2_catservice
-@echo ^<service^>
-@echo   ^<id^>HiveServer2^</id^>
-@echo   ^<name^>HiveServer2^</name^>
-@echo   ^<description^>Hadoop HiveServer2 Service^</description^>
-@echo   ^<executable^>%JAVA_HOME%\bin\java^</executable^>
-@echo   ^<arguments^>%JAVA_HEAP_MAX% %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH% %CLASS% -hiveconf hive.hadoop.classpath=%HIVE_LIB%\* -hiveconf hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator -hiveconf hive.metastore.uris=" " %HIVE_OPTS%^</arguments^>
-@echo ^</service^>
-goto :EOF
-
-:AddToHiveHbasePath
-if not defined HIVE_HBASE_PATH (
-   set HIVE_HBASE_PATH=%1
-   ) else (
-   set HIVE_HBASE_PATH=%HIVE_HBASE_PATH%;%1
-   )
-)
-goto :EOF

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/winpkg/src/template/bin/hiveserver2-ranger.cmd
----------------------------------------------------------------------
diff --git a/winpkg/src/template/bin/hiveserver2-ranger.cmd b/winpkg/src/template/bin/hiveserver2-ranger.cmd
new file mode 100644
index 0000000..3ed65df
--- /dev/null
+++ b/winpkg/src/template/bin/hiveserver2-ranger.cmd
@@ -0,0 +1,91 @@
+@echo off
+@rem Licensed to the Apache Software Foundation (ASF) under one or more
+@rem contributor license agreements.  See the NOTICE file distributed with
+@rem this work for additional information regarding copyright ownership.
+@rem The ASF licenses this file to You under the Apache License, Version 2.0
+@rem (the "License"); you may not use this file except in compliance with
+@rem the License.  You may obtain a copy of the License at
+@rem
+@rem     http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+set CLASS=org.apache.hive.service.server.HiveServer2
+pushd %HIVE_LIB%
+for /f %%a IN ('dir /b hive-service-*.jar') do (
+  set JAR=%HIVE_LIB%\%%a
+)
+popd
+
+if defined HBASE_HOME (
+	dir %HBASE_HOME%\lib > nul
+	if %errorlevel%==0 (
+		pushd %HBASE_HOME%\lib
+		set HIVE_HBASE_PATH=
+		for /f %%a IN ('dir /b hbase-server-**-hadoop2.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+		for /f %%a IN ('dir /b hbase-client-**-hadoop2.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+		for /f %%a IN ('dir /b hbase-protocol-**-hadoop2.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+		for /f %%a IN ('dir /b htrace-core-**.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+		for /f %%a IN ('dir /b hbase-common-**-hadoop2.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+		for /f %%a IN ('dir /b hbase-hadoop-compat-**-hadoop2.jar') do (
+		  call :AddToHiveHbasePath  %HBASE_HOME%\lib\%%a
+		)
+    )
+    popd
+	if defined HBASE_CONF_DIR (
+		dir %HBASE_CONF_DIR% > nul
+		if %errorlevel%==0 (
+			call :AddToHiveHbasePath  %HBASE_CONF_DIR%
+		)
+	)
+  )
+)
+
+if [%1]==[hiveserver2_help] goto :hiveserver2_help
+
+if [%1]==[hiveserver2_catservice] goto :hiveserver2_catservice
+
+:hiveserver2
+  echo "Starting Hive Thrift Server"
+
+  @rem hadoop 20 or newer - skip the aux_jars option and hiveconf
+  call %HIVE_BIN_PATH%\ext\util\execHiveCmd.cmd %CLASS%
+goto :EOF
+
+:hiveserver2_help
+  set HIVEARGS=-h
+  goto :hiveserver2
+goto :EOF
+
+:hiveserver2_catservice
+@echo ^<service^>
+@echo   ^<id^>HiveServer2^</id^>
+@echo   ^<name^>HiveServer2^</name^>
+@echo   ^<description^>Hadoop HiveServer2 Service^</description^>
+@echo   ^<executable^>%JAVA_HOME%\bin\java^</executable^>
+@echo   ^<arguments^>%JAVA_HEAP_MAX% %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH% %CLASS% -hiveconf hive.hadoop.classpath=%HIVE_LIB%\* -hiveconf hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator -hiveconf hive.metastore.uris=" " %HIVE_OPTS%^</arguments^>
+@echo ^</service^>
+goto :EOF
+
+:AddToHiveHbasePath
+if not defined HIVE_HBASE_PATH (
+   set HIVE_HBASE_PATH=%1
+   ) else (
+   set HIVE_HBASE_PATH=%HIVE_HBASE_PATH%;%1
+   )
+)
+goto :EOF

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/eca811d2/winpkg/src/template/bin/xasecure-hadoop-env.cmd
----------------------------------------------------------------------
diff --git a/winpkg/src/template/bin/xasecure-hadoop-env.cmd b/winpkg/src/template/bin/xasecure-hadoop-env.cmd
index 6ae2a7d..79aeb92 100644
--- a/winpkg/src/template/bin/xasecure-hadoop-env.cmd
+++ b/winpkg/src/template/bin/xasecure-hadoop-env.cmd
@@ -3,12 +3,16 @@ if not defined HADOOP_HOME (
 	set HADOOP_HOME=%~dp0
 )
 
-for /f "usebackq delims=|" %%G in (`dir /b "%HADOOP_HOME%\share\hadoop\common\lib" ^| findstr /i "^hdfs-plugin-.*\.jar"`) do (
+for /f "usebackq delims=|" %%G in (`dir /b "%HADOOP_HOME%\share\hadoop\common\lib" ^| findstr /i "^ranger-hdfs-plugin-.*\.jar"`) do (
 
     set "XASECURE_PLUGIN_PATH=%HADOOP_HOME%\share\hadoop\common\lib\%%~G"
 
 )
 
+if not defined XASECURE_PLUGIN_PATH (
+	goto exit
+)
+
 if exist %XASECURE_PLUGIN_PATH% (
 
 	set XASECURE_PLUGIN_OPTS= -javaagent:%XASECURE_PLUGIN_PATH%=authagent
@@ -19,6 +23,6 @@ if exist %XASECURE_PLUGIN_PATH% (
 		set HADOOP_NAMENODE_OPTS= %XASECURE_PLUGIN_OPTS% %HADOOP_NAMENODE_OPTS%
 		set HADOOP_SECONDARYNAMENODE_OPTS= %XASECURE_PLUGIN_OPTS% %HADOOP_SECONDARYNAMENODE_OPTS%
     )
-) else (
-    rem %XASECURE_PLUGIN_PATH% file doesn't exist
-)
+) 
+
+:exit