You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "peng.jianhua (JIRA)" <ji...@apache.org> on 2017/07/13 08:59:00 UTC

[jira] [Created] (RANGER-1693) The pidf's assignment logic in ranger-kms-initd should be consistent with the pidf's assignment logic in ranger-kms

peng.jianhua created RANGER-1693:
------------------------------------

             Summary: The pidf's assignment logic in ranger-kms-initd should be consistent with the pidf's assignment logic in ranger-kms
                 Key: RANGER-1693
                 URL: https://issues.apache.org/jira/browse/RANGER-1693
             Project: Ranger
          Issue Type: Bug
          Components: kms
            Reporter: peng.jianhua
            Assignee: peng.jianhua


The pidf's assignment logic in ranger-kms-initd is as following:
pidf=/var/run/ranger_kms/rangerkms.pid
if [ -f $pidf ]; then
	pid=`cat $pidf`
else
    pid=`ps -ef | grep java | grep -- '-Dproc_rangerkms' | grep -v grep | awk '{ print $2 }'`
fi

the pidf's assignment logic in ranger-kms is as following:
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
if [ ! -d "${RANGER_KMS_PID_DIR_PATH}" ]
then
	mkdir -p  $RANGER_KMS_PID_DIR_PATH
	chmod 660 $RANGER_KMS_PID_DIR_PATH
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 the value of RANGER_KMS_PID_DIR_PATH variable was changed, the value of pidf in ranger-kms-initd is error.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)