[
https://issues.apache.org/jira/browse/RANGER-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
wu.kehua updated RANGER-2549:
-----------------------------
Description:
The install.sh will print 'Command not found' when installing the solr audit
log module, as follow:
{code:java}
[root@wkh001 solr_for_audit_setup]# ./setup.sh
./setup.sh: line 29: log: Command not found
{code}
Then I analyse the install.sh, there is one error code, as follow:
{code:java}
if test -z "$validateProperty" ; then log "[E] '$1' not found in $2 file while
getting....!!"; exit 1; fi
{code}
Because the function log is undefined, and in other places, we use echo to
print log, We need to be unified as 'echo'.
When I modify this bug, then execute setup.sh, it shows another error, as
follow:
{code:java}
setup.sh: line 68:[: Too many parameters
{code}
Then I find another logic bug, if you don't config JAVA_HOME in
install.properties, CONFIG_JAVA_HOME will get an error message and influence
subsequent processe.
{code:java}
CONFIG_JAVA_HOME=$(get_prop 'JAVA_HOME' $PROPFILE)
JAVA_HOME=${CONFIG_JAVA_HOME:-$JAVA_HOME}
{code}
So I modified two places, and test in two scenes, one is that JAVA_HOME is not
configured, another is JAVA_HOME is configured.
Please check my patch, thanks.
was:
The install.sh will print 'Command not found' when installing the solr audit
log module, as follow:
{code:java}
[root@wkh001 solr_for_audit_setup]# ./setup.sh
./setup.sh: line 29: log: Command not found
{code}
Then I analyse the install.sh, there is one error code, as follow:
{code:java}
if test -z "$validateProperty" ; then log "[E] '$1' not found in $2 file while
getting....!!"; exit 1; fi
{code}
Because the function log is undefined, and in other places, we use echo to
print log, We need to be unified as 'echo'.
When I modify this bug, then execute setup.sh, it shows another error, as
follow:
{code:java}
setup.sh: line 68:[: Too many parameters
{code}
Then I find another logic bug, if you don't config JAVA_HOME in
install.properties, CONFIG_JAVA_HOME will get an error message and influence
subsequent processe.
{code:java}
CONFIG_JAVA_HOME=$(get_prop 'JAVA_HOME' $PROPFILE)
JAVA_HOME=${CONFIG_JAVA_HOME:-$JAVA_HOME}
{code}
So I modified two places, and test in two scenes, one is that JAVA_HOME is not
configured, another is JAVA_HOME is configured.
Please check my patch, thanks.
> There is two logic errors when installing the solr audit log module
> -------------------------------------------------------------------
>
> Key: RANGER-2549
> URL: https://issues.apache.org/jira/browse/RANGER-2549
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Affects Versions: 2.1.0
> Reporter: wu.kehua
> Assignee: wu.kehua
> Priority: Trivial
> Labels: patch
>
> The install.sh will print 'Command not found' when installing the solr audit
> log module, as follow:
> {code:java}
> [root@wkh001 solr_for_audit_setup]# ./setup.sh
> ./setup.sh: line 29: log: Command not found
> {code}
> Then I analyse the install.sh, there is one error code, as follow:
> {code:java}
> if test -z "$validateProperty" ; then log "[E] '$1' not found in $2 file
> while getting....!!"; exit 1; fi
> {code}
> Because the function log is undefined, and in other places, we use echo to
> print log, We need to be unified as 'echo'.
> When I modify this bug, then execute setup.sh, it shows another error, as
> follow:
> {code:java}
> setup.sh: line 68:[: Too many parameters
> {code}
> Then I find another logic bug, if you don't config JAVA_HOME in
> install.properties, CONFIG_JAVA_HOME will get an error message and influence
> subsequent processe.
> {code:java}
> CONFIG_JAVA_HOME=$(get_prop 'JAVA_HOME' $PROPFILE)
> JAVA_HOME=${CONFIG_JAVA_HOME:-$JAVA_HOME}
> {code}
> So I modified two places, and test in two scenes, one is that JAVA_HOME is
> not configured, another is JAVA_HOME is configured.
> Please check my patch, thanks.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)