[ 
https://issues.apache.org/jira/browse/KNOX-494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

J.Andreina updated KNOX-494:
----------------------------
    Attachment: KNOX-494.2.patch

Thanks Larry McCay for reviewing the patch. 

Please find below the current behavior if JAVA is not set :

In case if knoxcli.sh is executed in an environment where JAVA is not set , 
then below is the exception thrown and execution will fail.
{noformat}
Rex@XXXXXXXX:/home/Knox/knox-0.6.0-SNAPSHOT/bin> ./knoxcli.sh
./knoxcli.sh: line 61: -jar: command not found
{noformat}

In case of gateway.sh and ldap.sh , we can perform start/stop/status/clean . 
        For status,clean,stop operations does not need JAVA to be set , as they 
are fetching pid from pid file and using "ps -p <pid>" to check the status.

       But start operation needs JAVA to be set . If JAVA is not set following 
is the error message which is displayed and startup will fail. 
{noformat}
Rex@XXXXXXXX:/home/Knox/knox-0.6.0-SNAPSHOT/bin> ./gateway.sh start
Starting Gateway failed.
Rex@XXXXXXXX:/home/Knox/knox-0.6.0-SNAPSHOT/bin> cat ../logs/gateway.err
nohup: invalid option -- 'j'
Try `nohup --help' for more information.
{noformat}

I added an exit if JAVA is not set , with an intention that if the script is 
changed in future for stop|clean|status to depend on JAVA , then there is no 
need to continue with the operation , as followed in Hadoop.

I too agree with your point that patch will break the existing deployment if 
JAVA is not set . Ill update the patch to display a Warning message and 
continue with operation .

Please review the updated patch.


> knox-env.sh script should exit with proper error message , if JAVA is not 
> set. 
> -------------------------------------------------------------------------------
>
>                 Key: KNOX-494
>                 URL: https://issues.apache.org/jira/browse/KNOX-494
>             Project: Apache Knox
>          Issue Type: Bug
>            Reporter: J.Andreina
>            Assignee: J.Andreina
>         Attachments: KNOX-494.1.patch, KNOX-494.2.patch
>
>
> knox-env.sh script  does not exit when JAVA is not set .
> Hence execution of other script (which invokes knox-env.sh to set JAVA) in an 
> environment which does not contains JAVA , continues with execution and logs 
> non-user friendly messages as below
> {noformat}
> Execution of gateway.sh:
> nohup: invalid option -- 'j'
> Try `nohup --help' for more information.
> {noformat}
> {noformat}
> Execution of knoxcli.sh :
> ./knoxcli.sh: line 61: -jar: command not found
> {noformat}



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

Reply via email to