You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by lsimons <gi...@git.apache.org> on 2014/09/04 10:42:39 UTC

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

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 <ls...@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.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by karuturi <gi...@git.apache.org>.
Github user karuturi commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54608409
  
    ok. understood. Thanks.
    
    I am committing this to master. Do you want this in any other branch? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by karuturi <gi...@git.apache.org>.
Github user karuturi commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54590261
  
    If JAVA_HOME is not set, setJavaHome()(cloud-usage.rc:49)  method is trying to find it from default java available using something like `JAVA_HOME=$(dirname $(dirname $(readlink -e $(which java)))) ` and exits if couldn't find anything.
    wouldn't that work in this case?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by lsimons <gi...@git.apache.org>.
Github user lsimons commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54626548
  
    Sweet, thanks!
    
    Personally I think just having it on master is ok -- anyone that is likely to run into this issue is also likely to have configuration management (like chef) in place to edit their cloudstack-usage script if they need to do so.
    
    Of course it's a low-risk merge so there isn't anything _wrong_ with merging to 4.4, but, 4.4 still has the old style logic for choosing $JAVA_HOME, so those changes would have to be cherry-picked too, and that implies changes to preferential status of 1.7 vs 1.6 for 4.4.........so I would guess, just leave it for 4.5.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by lsimons <gi...@git.apache.org>.
Github user lsimons closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54629994
  
    We should have the fix on 4.4 as well, if it does not break anything and we'll be using 1.7jre/jdk since 4.3; we don't guarantee if 1.6 will work for ACS. You should drop an email to Daan to pick this up for 4.4 if you want it in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by lsimons <gi...@git.apache.org>.
Github user lsimons commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54600044
  
    I'm afraid not. This fix actually counts on setJavaHome() succeeding -- but _after_ that, that value does not make it to JSVC. The call to daemon calls runuser which, depending on configuration, *does not pass along environment variables like JAVA_HOME*.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: Fix CLOUDSTACK-7476: always pass along $J...

Posted by karuturi <gi...@git.apache.org>.
Github user karuturi commented on the pull request:

    https://github.com/apache/cloudstack/pull/15#issuecomment-54612516
  
    committed https://github.com/apache/cloudstack/commit/0ec36e128bb06704bfe4e9b115aaf4680ee61a43
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---