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/09 06:48:33 UTC

ranger git commit: RANGER-1600:In install.properties, I configured the testusr user and the testgroup groups that not exist in system. The error “chown: invalid user: testusr:testgroup” occured during installed the hbase plugin.

Repository: ranger
Updated Branches:
  refs/heads/master 2d8895e6d -> fbfa3193d


RANGER-1600:In install.properties, I configured the testusr user and the testgroup groups that not exist in system. The error “chown: invalid user: testusr:testgroup” occured during installed the hbase plugin.

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/fbfa3193
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/fbfa3193
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/fbfa3193

Branch: refs/heads/master
Commit: fbfa3193d9b267c18e95048d177f8d68f31a61ff
Parents: 2d8895e
Author: peng.jianhua <pe...@zte.com.cn>
Authored: Mon May 22 22:07:56 2017 -0400
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Fri Jun 9 02:45:03 2017 -0400

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/fbfa3193/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index a74289a..562a404 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -133,17 +133,28 @@ CUSTOM_USER=${CUSTOM_USER// }
 CUSTOM_GROUP=$(getInstallProperty 'CUSTOM_GROUP')
 CUSTOM_GROUP=${CUSTOM_GROUP// }
 
+CUSTOM_GROUP_STATUS=${CUSTOM_GROUP};
+CUSTOM_USER_STATUS=${CUSTOM_USER};
+egrep "^$CUSTOM_GROUP" /etc/group >& /dev/null
+if [ $? -ne 0 ]
+then
+	CUSTOM_GROUP_STATUS=""
+fi
+id -u ${CUSTOM_USER} > /dev/null 2>&1
+if [ $? -ne 0 ]
+then
+	CUSTOM_USER_STATUS=""
+fi
 
-
-if [ ! -z "${CUSTOM_USER}" ] && [ ! -z "${CUSTOM_GROUP}" ]
+if [ ! -z "${CUSTOM_USER_STATUS}" ] && [ ! -z "${CUSTOM_GROUP_STATUS}" ]
 then
   echo "Custom user and group is available, using custom user and group."
   CFG_OWNER_INF="${CUSTOM_USER}:${CUSTOM_GROUP}"
-elif [ ! -z "${CUSTOM_USER}" ] && [ -z "${CUSTOM_GROUP}" ]
+elif [ ! -z "${CUSTOM_USER_STATUS}" ] && [ -z "${CUSTOM_GROUP_STATUS}" ]
 then
   echo "Custom user is available, using custom user and default group."
   CFG_OWNER_INF="${CUSTOM_USER}:${HCOMPONENT_NAME}"
-elif [ -z  "${CUSTOM_USER}" ] && [ ! -z  "${CUSTOM_GROUP}" ]
+elif [ -z  "${CUSTOM_USER_STATUS}" ] && [ ! -z  "${CUSTOM_GROUP_STATUS}" ]
 then
   echo "Custom group is available, using default user and custom group."
   CFG_OWNER_INF="${HCOMPONENT_NAME}:${CUSTOM_GROUP}"