ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhangqi...@apache.org
Subject ranger git commit: RANGER-1856:Installation and access logic are inconsistent for the pid of kms program. Like security admin, they should be consistent.
Date Fri, 27 Oct 2017 01:05:38 GMT
Repository: ranger
Updated Branches:
  refs/heads/master e16fd4c33 -> 454be055e


RANGER-1856:Installation and access logic are inconsistent for the pid of kms program. Like
security admin, they should be consistent.

Signed-off-by: zhangqiang2 <zhangqiang2@zte.com.cn>


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

Branch: refs/heads/master
Commit: 454be055e496921c7384ada2cb1d00120c83bc48
Parents: e16fd4c
Author: peng.jianhua <peng.jianhua@zte.com.cn>
Authored: Wed Oct 25 10:21:05 2017 +0800
Committer: zhangqiang2 <zhangqiang2@zte.com.cn>
Committed: Thu Oct 26 20:48:09 2017 -0400

----------------------------------------------------------------------
 kms/scripts/setup.sh | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/454be055/kms/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/kms/scripts/setup.sh b/kms/scripts/setup.sh
index 0b13ab4..6e4b7e2 100755
--- a/kms/scripts/setup.sh
+++ b/kms/scripts/setup.sh
@@ -22,11 +22,6 @@
 PROPFILE=$PWD/install.properties
 propertyValue=''
 
-pidFolderName='/var/run/ranger_kms'
-if [ ! -d "${pidFolderName}" ]; then
-    mkdir -p "${pidFolderName}"
-fi
-
 if [ ! -f ${PROPFILE} ]
 then
 	echo "$PROPFILE file not found....!!";
@@ -866,13 +861,21 @@ setup_install_files(){
         echo "export RANGER_KMS_LOG_DIR=${RANGER_KMS_LOG_DIR}" > ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-kms-env-logdir.sh
     	chmod a+rx ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-kms-env-logdir.sh
 
+        if [ -z "${RANGER_KMS_PID_DIR_PATH}" ]
+		then
+			RANGER_KMS_PID_DIR_PATH=/var/run/ranger_kms
+		fi
         if [ ! -d ${RANGER_KMS_PID_DIR_PATH} ]; then
-                log "[I] Creating KMS PID folder: ${RANGER_KMS_PID_DIR_PATH}"
-                mkdir -p ${RANGER_KMS_PID_DIR_PATH}
-        fi
-        if [ -d ${RANGER_KMS_PID_DIR_PATH} ]; then
-                chown -R ${unix_user} ${RANGER_KMS_PID_DIR_PATH}
+            log "[I] Creating KMS PID folder: ${RANGER_KMS_PID_DIR_PATH}"
+            mkdir -p ${RANGER_KMS_PID_DIR_PATH}
+            if [ ! $? = "0" ];then
+                log "Make $RANGER_KMS_PID_DIR_PATH failure....!!";
+                exit 1;
+            fi
         fi
+
+        chown -R ${unix_user} ${RANGER_KMS_PID_DIR_PATH}
+
         echo "export RANGER_KMS_PID_DIR_PATH=${RANGER_KMS_PID_DIR_PATH}" > ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-kms-env-piddir.sh
         echo "export KMS_USER=${unix_user}" >> ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-kms-env-piddir.sh
         chmod a+rx ${WEBAPP_ROOT}/WEB-INF/classes/conf/ranger-kms-env-piddir.sh


Mime
View raw message