ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject ranger git commit: RANGER-1449:RANGER-1449:There is logical inconsistency for RANGER_PID_DIR_PATH in security admin
Date Tue, 21 Mar 2017 17:11:55 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 3632b35d0 -> 79230377f


RANGER-1449:RANGER-1449:There is logical inconsistency for RANGER_PID_DIR_PATH in security
admin

Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/79230377
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/79230377
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/79230377

Branch: refs/heads/master
Commit: 79230377fd1e27c28e330dfac0f382c1a78b710d
Parents: 3632b35
Author: peng.jianhua <peng.jianhua@zte.com.cn>
Authored: Tue Mar 21 03:03:54 2017 -0400
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Mar 21 17:11:07 2017 +0000

----------------------------------------------------------------------
 security-admin/scripts/setup.sh | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/79230377/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index 87be127..bc94874 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -49,12 +49,6 @@ if [ ! -f "${PROPFILE}" ]; then
 fi
 
 LOGFILE=$(eval echo " $(get_prop 'LOGFILE' $PROPFILE)")
-pidFolderName='/var/run/ranger'
-mkdir -p ${pidFolderName}
-if [ ! $? = "0" ];then
-    log "Make $pidFolderName failure....!!";
-    exit 1;
-fi
 
 PYTHON_COMMAND_INVOKER=$(get_prop 'PYTHON_COMMAND_INVOKER' $PROPFILE)
 DB_FLAVOR=$(get_prop 'DB_FLAVOR' $PROPFILE)
@@ -1363,14 +1357,22 @@ setup_install_files(){
         fi
         echo "export RANGER_ADMIN_LOG_DIR=${RANGER_ADMIN_LOG_DIR}" > ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-admin-env-logdir.sh
         chmod a+rx ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-admin-env-logdir.sh
-
+		
+		if [ -z "${RANGER_PID_DIR_PATH}" ]
+		then
+			RANGER_PID_DIR_PATH=/var/run/ranger
+		fi
         if [ ! -d ${RANGER_PID_DIR_PATH} ]; then
-                log "[I]Creating Ranger PID folder: ${RANGER_PID_DIR_PATH}"
-                mkdir -p ${RANGER_PID_DIR_PATH}
-        fi
-        if [ -d ${RANGER_PID_DIR_PATH} ]; then
-                chown -R ${unix_user} ${RANGER_PID_DIR_PATH}
+			log "[I]Creating Ranger PID folder: ${RANGER_PID_DIR_PATH}"
+			mkdir -p ${RANGER_PID_DIR_PATH}
+			if [ ! $? = "0" ];then
+				log "Make $RANGER_PID_DIR_PATH failure....!!";
+				exit 1;
+			fi
         fi
+		
+        chown -R ${unix_user} ${RANGER_PID_DIR_PATH}
+		
         echo "export RANGER_PID_DIR_PATH=${RANGER_PID_DIR_PATH}" > ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-admin-env-piddir.sh
         echo "export RANGER_USER=${unix_user}" >> ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-admin-env-piddir.sh
         chmod a+rx ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-admin-env-piddir.sh


Mime
View raw message