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/08/23 01:37:27 UTC

ranger git commit: RANGER-1741:The initd ran repeatedly when ranger-usersync-services.sh was running

Repository: ranger
Updated Branches:
  refs/heads/master 32999cd07 -> a9523814c


RANGER-1741:The initd ran repeatedly when ranger-usersync-services.sh was running

Signed-off-by: zhangqiang2 <zh...@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/a9523814
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/a9523814
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/a9523814

Branch: refs/heads/master
Commit: a9523814cf4b3763a3a8db7d7eb3161e624074c5
Parents: 32999cd
Author: peng.jianhua <pe...@zte.com.cn>
Authored: Sun Aug 20 05:08:52 2017 -0400
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Tue Aug 22 21:35:09 2017 -0400

----------------------------------------------------------------------
 unixauthservice/scripts/initd | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/a9523814/unixauthservice/scripts/initd
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/initd b/unixauthservice/scripts/initd
index a1062af..361b1d5 100644
--- a/unixauthservice/scripts/initd
+++ b/unixauthservice/scripts/initd
@@ -26,11 +26,22 @@
 LINUX_USER=ranger
 BIN_PATH=/usr/bin
 MOD_NAME=ranger-usersync
-pidf=/var/run/ranger/usersync.pid
+
+if [ -z "${USERSYNC_PID_DIR_PATH}" ]; then
+        USERSYNC_PID_DIR_PATH=/var/run/ranger
+fi
+if [ -z "${USERSYNC_PID_NAME}" ]
+then
+        USERSYNC_PID_NAME=usersync.pid
+fi
+pidf=${USERSYNC_PID_DIR_PATH}/${USERSYNC_PID_NAME}
+
 pid=""
 if [ -f ${pidf} ]
 then
-    pid=`cat $pidf`
+    pid=`cat $pidf` > /dev/null 2>&1
+else
+    pid=`ps -ef | grep java | grep -- '-Dproc_rangerusersync' | grep -v grep | awk '{ print $2 }'`
 fi
 
 case $1 in