ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject incubator-argus git commit: ARGUS-175:Added parameter for unix auth service to enable/disable auth
Date Sun, 09 Nov 2014 09:21:31 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/ranger-0.4 1d9072429 -> 42875485d


ARGUS-175:Added parameter for unix auth service to enable/disable auth

Signed-off-by: sneethiraj <sneethir@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/42875485
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/42875485
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/42875485

Branch: refs/heads/ranger-0.4
Commit: 42875485d9bcc918f66840be4d9d2760c4db26ec
Parents: 1d90724
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Sun Nov 9 04:13:58 2014 -0500
Committer: sneethiraj <sneethir@apache.org>
Committed: Sun Nov 9 04:21:24 2014 -0500

----------------------------------------------------------------------
 unixauthservice/scripts/start.sh                |  2 +-
 .../UnixAuthenticationService.java              | 22 +++++++++++++++-----
 2 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/42875485/unixauthservice/scripts/start.sh
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/start.sh b/unixauthservice/scripts/start.sh
index 07b0315..7f9ebce 100755
--- a/unixauthservice/scripts/start.sh
+++ b/unixauthservice/scripts/start.sh
@@ -48,7 +48,7 @@ cp="${cdir}/dist/*:${cdir}/lib/*:${cdir}/conf"
 ${cdir}/stop.sh
 cd ${cdir}
 umask 0077
-nohup java -Dproc_rangerusersync ${JAVA_OPTS} -Dlogdir="${logdir}" -cp "${cp}" com.xasecure.authentication.UnixAuthenticationService
> ${logdir}/auth.log 2>&1 &
+nohup java -Dproc_rangerusersync ${JAVA_OPTS} -Dlogdir="${logdir}" -cp "${cp}" com.xasecure.authentication.UnixAuthenticationService
-enableUnixAuth > ${logdir}/auth.log 2>&1 &
 echo $! >  ${pidf}
 sleep 5
 port=`grep  '^[ ]*authServicePort' ${cdir}/conf/unixauthservice.properties | awk -F= '{ print
$2 }' | awk '{ print $1 }'`

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/42875485/unixauthservice/src/main/java/com/xasecure/authentication/UnixAuthenticationService.java
----------------------------------------------------------------------
diff --git a/unixauthservice/src/main/java/com/xasecure/authentication/UnixAuthenticationService.java
b/unixauthservice/src/main/java/com/xasecure/authentication/UnixAuthenticationService.java
index bd9eac2..ba6b8f3 100644
--- a/unixauthservice/src/main/java/com/xasecure/authentication/UnixAuthenticationService.java
+++ b/unixauthservice/src/main/java/com/xasecure/authentication/UnixAuthenticationService.java
@@ -62,9 +62,6 @@ public class UnixAuthenticationService {
 	private static final String ADMIN_ROLE_LIST_PARAM = "admin.roleNames" ;
 	private static final String SSL_ENABLED_PARAM = "useSSL" ;
 	
-	
-
-
 	private String keyStorePath ;
 	private String keyStorePathPassword ;
 	private String trustStorePath ;
@@ -76,8 +73,17 @@ public class UnixAuthenticationService {
 	
 	private boolean SSLEnabled = false ;
 	
+	static private boolean enableUnixAuth = false;
 
 	public static void main(String[] args) {
+		if (args.length > 0) {
+			for (String s : args) {
+				if ("-enableUnixAuth".equalsIgnoreCase(s)) {
+					enableUnixAuth = true;
+					break;
+				}
+			}
+		}
 		UnixAuthenticationService service = new UnixAuthenticationService() ;
 		service.run() ;
 	}
@@ -88,9 +94,15 @@ public class UnixAuthenticationService {
 	
 	public void run() {
 		try {
+			LOG.info("Starting User Sync Service!");
 			startUnixUserGroupSyncProcess() ;
-			init() ;
-			startService() ;
+			if (enableUnixAuth) {
+				LOG.info("Enabling Unix Auth Service!");
+			    init() ;
+			    startService() ;
+			} else {
+				LOG.info("Unix Auth Service Disabled!");
+			}
 		}
 		catch(Throwable t) {
 			LOG.error("ERROR: Service: " + serviceName , t);


Mime
View raw message