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/15 00:47:31 UTC

ranger git commit: RANGER-1641:Like security admin and usersync, the kms installer should chech whether the user group exists before creating the user group.

Repository: ranger
Updated Branches:
  refs/heads/master 08d9c4e33 -> 42657fdb8


RANGER-1641:Like security admin and usersync, the kms installer should chech whether the user group exists before creating the user group.

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

Branch: refs/heads/master
Commit: 42657fdb849f9e96e87c3f16f7c06a639600253a
Parents: 08d9c4e
Author: zhangqiang2 <zh...@zte.com.cn>
Authored: Wed Jun 14 02:27:54 2017 -0400
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Wed Jun 14 20:46:56 2017 -0400

----------------------------------------------------------------------
 kms/scripts/setup.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/42657fdb/kms/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/kms/scripts/setup.sh b/kms/scripts/setup.sh
index c8d7519..297fdd2 100755
--- a/kms/scripts/setup.sh
+++ b/kms/scripts/setup.sh
@@ -753,11 +753,14 @@ update_properties() {
 #=====================================================================
 
 setup_unix_user_group(){
-
 	log "[I] Setting up UNIX user : ${unix_user} and group: ${unix_group}";
-
-    groupadd ${unix_group}
-    check_ret_status_for_groupadd $? "Creating group ${unix_group} failed"
+	#create group if it does not exist
+	egrep "^$unix_group" /etc/group >& /dev/null
+	if [ $? -ne 0 ]
+	then
+		groupadd ${unix_group}
+		check_ret_status_for_groupadd $? "Creating group ${unix_group} failed"
+	fi
 
 	id -u ${unix_user} > /dev/null 2>&1