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

ASF GitHub Bot commented on CLOUDSTACK-7476:
--------------------------------------------

GitHub user lsimons opened a pull request:

    https://github.com/apache/cloudstack/pull/15

    Fix CLOUDSTACK-7476: always pass along $JAVA_HOME

    On a secured environment (selinux w/ env_reset enabled in sudoers), the
    runuser command that is invoked by the daemon() function does not pass
    along environment variables, so $JAVA_HOME is empty, and JSVC falls
    back to its default behavior, which may not find java or may not find
    the intended java.
    
    This fix simply passes $JAVA_HOME explicitly using the -home argument to
    JSVC.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/schubergphilis/cloudstack 
bugfix/CLOUDSTACK-7476

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/15.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #15
    
----
commit da9647205aafccee3ae8b60b6ccdee0dcad8c712
Author: Leo Simons <lsim...@schubergphilis.com>
Date:   2014-09-03T07:32:32Z

    Fix CLOUDSTACK-7476: always pass along $JAVA_HOME
    
    On a secured environment (selinux w/ env_reset enabled in sudoers), the
    runuser command that is invoked by the daemon() function does not pass
    along environment variables, so $JAVA_HOME is empty, and JSVC falls
    back to its default behavior, which may not find java or may not find
    the intended java.
    
    This fix simply passes $JAVA_HOME explicitly using the -home argument to
    JSVC.

----


> centos cloudstack-usage script does not always pass along $JAVA_HOME
> --------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-7476
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7476
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Usage
>    Affects Versions: 4.5.0
>         Environment: secured centos/redhat
>            Reporter: Leo Simons
>             Fix For: 4.5.0
>
>
> /etc/init.d/cloudstack-usage finds a $JAVA_HOME and makes sure the 
> environment variable is set, then assumes this variable will be picked up by 
> JSVC.
> However, on a secured environment (selinux w/ env_reset enabled in sudoers), 
> the runuser command that is invoked by the daemon() function does not pass 
> along environment variables, so $JAVA_HOME is empty, and JSVC falls back to 
> its default behavior, which may not find java or may not find the intended 
> java.
> The simple solution is to pass -home to JSVC, passing it on the command line 
> instead of as an environment variable.
> I'll provide a patch.



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

Reply via email to