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/10/08 05:15:05 UTC
git commit: ARGUS-104: Fixed Review comments to externalize UserSync
Log file path to support Windows
Repository: incubator-argus
Updated Branches:
refs/heads/master cd7e677ae -> e5b95a7d0
ARGUS-104: Fixed Review comments to externalize UserSync Log file path to support Windows
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/e5b95a7d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/e5b95a7d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/e5b95a7d
Branch: refs/heads/master
Commit: e5b95a7d0a5a0d39650f01c948ebdc4de788caee
Parents: cd7e677
Author: vperiasamy <vp...@hortonworks.com>
Authored: Tue Oct 7 16:22:30 2014 -0400
Committer: sneethiraj <sn...@apache.org>
Committed: Tue Oct 7 23:14:37 2014 -0400
----------------------------------------------------------------------
unixauthservice/conf/log4j.xml | 2 +-
unixauthservice/conf/unixauthservice.properties | 2 ++
unixauthservice/scripts/install.properties | 2 ++
unixauthservice/scripts/start.sh | 10 +++++++---
4 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e5b95a7d/unixauthservice/conf/log4j.xml
----------------------------------------------------------------------
diff --git a/unixauthservice/conf/log4j.xml b/unixauthservice/conf/log4j.xml
index dd775c2..18748e4 100644
--- a/unixauthservice/conf/log4j.xml
+++ b/unixauthservice/conf/log4j.xml
@@ -4,7 +4,7 @@
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<appender name="logFile" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="file" value="/var/log/uxugsync/unix-auth-sync.log" />
+ <param name="file" value="${logdir}/unix-auth-sync.log" />
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n"/>
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e5b95a7d/unixauthservice/conf/unixauthservice.properties
----------------------------------------------------------------------
diff --git a/unixauthservice/conf/unixauthservice.properties b/unixauthservice/conf/unixauthservice.properties
index 1b0cf93..3e6921a 100644
--- a/unixauthservice/conf/unixauthservice.properties
+++ b/unixauthservice/conf/unixauthservice.properties
@@ -132,3 +132,5 @@ ldapGroupSync.userGroupNameAttribute = memberof, ismemberof
# possible values: none, lower, upper
ldapGroupSync.username.caseConversion=lower
ldapGroupSync.groupname.caseConversion=lower
+#user sync log path
+logdir=/var/log/uxugsync
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e5b95a7d/unixauthservice/scripts/install.properties
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/install.properties b/unixauthservice/scripts/install.properties
index 4331fd2..e99b064 100644
--- a/unixauthservice/scripts/install.properties
+++ b/unixauthservice/scripts/install.properties
@@ -80,3 +80,5 @@ SYNC_LDAP_USER_GROUP_NAME_ATTRIBUTE = memberof,ismemberof
SYNC_LDAP_USERNAME_CASE_CONVERSION=lower
SYNC_LDAP_GROUPNAME_CASE_CONVERSION=lower
+#user sync log path
+logdir=/var/log/uxugsync
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e5b95a7d/unixauthservice/scripts/start.sh
----------------------------------------------------------------------
diff --git a/unixauthservice/scripts/start.sh b/unixauthservice/scripts/start.sh
index 4b03e91..8f21c3b 100755
--- a/unixauthservice/scripts/start.sh
+++ b/unixauthservice/scripts/start.sh
@@ -13,14 +13,18 @@ fi
pidf=${cdir}/.mypid
-logdir=/var/log/uxugsync
-
+#logdir=`grep '^[ \t]*logdir[ \t]*=' ${cdir}/install.properties | awk -F= '{ print $2 }' | sed -e 's:[ \t]*::g'`
+logdir=`grep -P '^[ \t]*logdir[ \t]*=' ${cdir}/install.properties | awk -F= '{ print $2 }' | tr '\t' ' ' | sed -e 's:[ ]::g'`
+if [ ! -d ${logdir} ]
+then
+ logdir=/var/log/uxugsync
+fi
cp="${cdir}/dist/*:${cdir}/lib/*:${cdir}/conf"
[ ! -d ${logdir} ] && mkdir -p ${logdir}
${cdir}/stop.sh
cd ${cdir}
umask 0077
-nohup java -cp "${cp}" com.xasecure.authentication.UnixAuthenticationService > ${logdir}/auth.log 2>&1 &
+nohup java -Dlogdir="${logdir}" -cp "${cp}" com.xasecure.authentication.UnixAuthenticationService > ${logdir}/auth.log 2>&1 &
echo $! > ${pidf}
sleep 5
port=`grep '^[ ]*authServicePort' ${cdir}/conf/unixauthservice.properties | awk -F= '{ print $2 }' | awk '{ print $1 }'`