You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2014/11/09 10:21:03 UTC

incubator-argus git commit: ARGUS-175:Added parameter for unix auth service to enable/disable auth

Repository: incubator-argus
Updated Branches:
  refs/heads/master 6a3118ae6 -> c282dca29


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

Signed-off-by: sneethiraj <sn...@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/c282dca2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/c282dca2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/c282dca2

Branch: refs/heads/master
Commit: c282dca296a5cd3df1ce9d9249efdde4c4194fb5
Parents: 6a3118a
Author: vperiasamy <vp...@hortonworks.com>
Authored: Sun Nov 9 04:13:58 2014 -0500
Committer: sneethiraj <sn...@apache.org>
Committed: Sun Nov 9 04:19:20 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/c282dca2/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/c282dca2/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);