You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jackson Chung (JIRA)" <ji...@apache.org> on 2011/06/17 03:00:53 UTC

[jira] [Created] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
---------------------------------------------------------------------------------------------------------------------

                 Key: CASSANDRA-2785
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
             Project: Cassandra
          Issue Type: Bug
            Reporter: Jackson Chung


I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh

In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

paul cannon updated CASSANDRA-2785:
-----------------------------------

    Attachment: 0002-fix-usage-of-bash-n-tests.patch.txt

Doh, I never knew that one. I normally quote everything, but was trying to match style.

I found a couple other places where we need to quote the argument to test -n.

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072849#comment-13072849 ] 

Eric Evans commented on CASSANDRA-2785:
---------------------------------------

committed; thanks!

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

paul cannon updated CASSANDRA-2785:
-----------------------------------

    Attachment: 0001-use-JAVA-in-cassandra-env.sh.patch.txt

patch 0001: Uses $JAVA in cassandra-env.sh instead of relying on $PATH.

Makes sure that JAVA is appropriately set from bin/cassandra and debian/init.

Changes debian initscript so that /etc/default/cassandra is sourced _before_ /etc/cassandra/cassandra-env.sh. I don't know of anyone using /etc/default/cassandra in such a way that this would be a problem. The change gives users a place to specify their own $JAVA_HOME if they so desire.

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080484#comment-13080484 ] 

paul cannon commented on CASSANDRA-2785:
----------------------------------------

I think this patch is still correct, and that the bug causing the regression was the invalid hard-coding of JAVA_HOME in redhat/cassandra. If the fix for CASSANDRA-2992 is acceptable, this should probably be re-closed as well.

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072766#comment-13072766 ] 

Eric Evans commented on CASSANDRA-2785:
---------------------------------------

+1

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2785:
--------------------------------------

      Component/s: Packaging
         Priority: Minor  (was: Major)
    Fix Version/s: 0.8.4

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 0.8.4
>
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-2785.
---------------------------------------

    Resolution: Fixed

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072222#comment-13072222 ] 

Eric Evans commented on CASSANDRA-2785:
---------------------------------------

The -n eval in bin/cassandra needs to be quoted or it'll read non-zero even when it's not.

{noformat}
--- a/bin/cassandra
+++ b/bin/cassandra
@@ -80,7 +80,7 @@ elif [ -r $CASSANDRA_INCLUDE ]; then
 fi
 
 # Use JAVA_HOME if set, otherwise look for java in PATH
-if [ -n $JAVA_HOME ]; then
+if [ -n "$JAVA_HOME" ]; then
     JAVA=$JAVA_HOME/bin/java
 else
     JAVA=java
{noformat}

Aside from that, +1

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reassigned CASSANDRA-2785:
-----------------------------------------

    Assignee: paul cannon

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne reopened CASSANDRA-2785:
-----------------------------------------


This is causing problems, see CASSANDRA-2992.

I have only reverted this patch on a specific branch so that it doesn't block 0.8.3 release. However, I have not reverted yet on 0.8 branch (or trunk), so that it could be fixed incrementally.

As a side note, it would be nice to set the correct fix version and reviewer when marking an issue resolved.

> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2785) should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072864#comment-13072864 ] 

Hudson commented on CASSANDRA-2785:
-----------------------------------

Integrated in Cassandra-0.8 #243 (See [https://builds.apache.org/job/Cassandra-0.8/243/])
    honor path to java when JAVA_HOME set

Patch by Paul Cannon; reviewed by eevans for CASSANDRA-2785

eevans : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1152241
Files : 
* /cassandra/branches/cassandra-0.8/conf/cassandra-env.sh
* /cassandra/branches/cassandra-0.8/debian/cassandra.postinst
* /cassandra/branches/cassandra-0.8/debian/init
* /cassandra/branches/cassandra-0.8/bin/cassandra


> should export JAVA variable in the bin/cassandra and use that in the cassandra-env.sh when check for the java version
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2785
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2785
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jackson Chung
>            Assignee: paul cannon
>         Attachments: 0001-use-JAVA-in-cassandra-env.sh.patch.txt, 0002-fix-usage-of-bash-n-tests.patch.txt
>
>
> I forgot which jira we add this java -version check in the cassandra-env.sh (for adding jamm to the javaagent), but we should probably use the variable JAVA set in bin/cassandra (will need export) and use $JAVA instead of "java" in the cassandra-env.sh
> In a situation where JAVA_HOME may have been properly set as the Sun's java but the PATH still have the OpenJDK's java in front, the check will fail to add the jamm.jar, even though the cassandra jvm is properly started via the Sun's java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira