[ 
https://issues.apache.org/jira/browse/RANGER-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260976#comment-14260976
 ] 

Gautam commented on RANGER-177:
-------------------------------

Evaluation of changes required to make the process run as non-root user:

# Make sure the unzipped folder is accessible to the following user:group : 
{{ranger:ranger}}
# Remove the {{netstat}} command, since only root user can run it.
# Options that can be used in place of {{netstat}} command :
## Run the ps/jps command and grep for `UnixAuthenticationService` OR
## Use the {{pidf}} file ( 4th line in below code ) which already stores the 
pid file of the process. 


{code:title=start.sh|borderStyle=solid}
cd ${cdir}
umask 0077
nohup java -Dproc_rangerusersync ${JAVA_OPTS} -Dlogdir="${logdir}" -cp "${cp}" 
org.apache.ranger.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 }'`
pid=`netstat -antp | grep LISTEN | grep  ${port} | awk '{ print $NF }' | awk 
-F/ '{ if ($2 == "java") { print $1 } }'`
if [ "${pid}" != "" ]
then
        echo "UnixAuthenticationService has started successfully."
else
        echo "UnixAuthenticationService failed to start. Please refer to log 
files under ${logdir} for further details."
fi
{code}

Kindly provide feedbacks, if any.


> usersync process should be modified to run as ranger just like policy admin 
> tool
> --------------------------------------------------------------------------------
>
>                 Key: RANGER-177
>                 URL: https://issues.apache.org/jira/browse/RANGER-177
>             Project: Ranger
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Selvamohan Neethiraj
>
> Usersync process should be modified to run with user ranger.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to