You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by zh...@apache.org on 2017/06/22 01:30:56 UTC

ranger git commit: RANGER-1660:Similar to RANGER-1575, the kms should also support the same new feature.

Repository: ranger
Updated Branches:
  refs/heads/master ba29b4094 -> 84de2f030


RANGER-1660:Similar to RANGER-1575, the kms should also support the same new feature.

Signed-off-by: peng.jianhua <pe...@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/84de2f03
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/84de2f03
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/84de2f03

Branch: refs/heads/master
Commit: 84de2f030d92798e6715e180e00785f19d7c09bc
Parents: ba29b40
Author: peng.jianhua <pe...@zte.com.cn>
Authored: Tue Jun 20 23:54:01 2017 -0400
Committer: peng.jianhua <pe...@zte.com.cn>
Committed: Wed Jun 21 21:29:55 2017 -0400

----------------------------------------------------------------------
 kms/scripts/ranger-kms | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/84de2f03/kms/scripts/ranger-kms
----------------------------------------------------------------------
diff --git a/kms/scripts/ranger-kms b/kms/scripts/ranger-kms
index 11dc4ff..e902509 100755
--- a/kms/scripts/ranger-kms
+++ b/kms/scripts/ranger-kms
@@ -56,15 +56,30 @@ then
         RANGER_KMS_LOG_DIR=${RANGER_KMS_EWS_DIR}/logs
 fi
 
+if [ -z "${RANGER_KMS_PID_NAME}" ]
+then
+        RANGER_KMS_PID_NAME=rangerkms.pid
+fi
+
 if [ -z "${RANGER_KMS_PID_DIR_PATH}" ]
 then
-        RANGER_KMS_PID_DIR_PATH=/var/run/ranger_kms
+	RANGER_KMS_PID_DIR_PATH=/var/run/ranger_kms
+fi
+if [ ! -d "${RANGER_KMS_PID_DIR_PATH}" ]
+then
+	mkdir -p  $RANGER_KMS_PID_DIR_PATH
+	chmod 660 $RANGER_KMS_PID_DIR_PATH
 fi
-pidf=${RANGER_KMS_PID_DIR_PATH}/rangerkms.pid
+# User can set their own pid path using RANGER_KMS_PID_DIR_PATH and
+# RANGER_KMS_PID_NAME variable before calling the script. The user can modify
+# the value of the RANGER_KMS_PID_DIR_PATH in ranger-kms-env-piddir.sh to
+# change pid path and set the value of RANGER_KMS_PID_NAME to change the
+# pid file.
+pidf=${RANGER_KMS_PID_DIR_PATH}/${RANGER_KMS_PID_NAME}
 
 if [ -z "${KMS_USER}" ]
 then
-        KMS_USER=kms
+	KMS_USER=kms
 fi
 
 PROC_NAME=proc_rangerkms