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/07/15 06:33:23 UTC
ranger git commit: RANGER-1693:The pidf's assignment logic in
ranger-kms-initd should be consistent with the pidf's assignment logic in
ranger-kms
Repository: ranger
Updated Branches:
refs/heads/master 15fd7fa5d -> c5332d123
RANGER-1693:The pidf's assignment logic in ranger-kms-initd should be consistent with the pidf's assignment logic in ranger-kms
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/c5332d12
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/c5332d12
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/c5332d12
Branch: refs/heads/master
Commit: c5332d123411535f3dbfeef7b1872d97cc087bb2
Parents: 15fd7fa
Author: peng.jianhua <pe...@zte.com.cn>
Authored: Thu Jul 13 05:00:46 2017 -0400
Committer: peng.jianhua <pe...@zte.com.cn>
Committed: Sat Jul 15 02:30:40 2017 -0400
----------------------------------------------------------------------
kms/scripts/ranger-kms-initd | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/c5332d12/kms/scripts/ranger-kms-initd
----------------------------------------------------------------------
diff --git a/kms/scripts/ranger-kms-initd b/kms/scripts/ranger-kms-initd
index 8d4fa3d..2bade43 100755
--- a/kms/scripts/ranger-kms-initd
+++ b/kms/scripts/ranger-kms-initd
@@ -27,7 +27,30 @@
#LINUX_USER=kms
BIN_PATH=/usr/bin
MOD_NAME=ranger-kms
-pidf=/var/run/ranger_kms/rangerkms.pid
+
+realScriptPath=`readlink -f $0`
+realScriptDir=`dirname $realScriptPath`
+RANGER_KMS_DIR=`(cd $realScriptDir; pwd)`
+for custom_env_script in `find ${RANGER_KMS_DIR}/ews/webapp/WEB-INF/classes/conf/ -name "ranger-kms-env*"`; do
+ if [ -f $custom_env_script ]; then
+ . $custom_env_script
+ fi
+done
+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
+fi
+# 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 [ -f $pidf ]; then
pid=`cat $pidf`
else