You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Will McQueen (JIRA)" <ji...@apache.org> on 2012/04/26 12:29:18 UTC
[jira] [Created] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Will McQueen created FLUME-1154:
-----------------------------------
Summary: flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
Key: FLUME-1154
URL: https://issues.apache.org/jira/browse/FLUME-1154
Project: Flume
Issue Type: Bug
Components: Shell
Affects Versions: v1.2.0
Reporter: Will McQueen
Fix For: v1.2.0
Please see bin/flume-ng script, under the "#find java" section.
It says:
# find java
if [ -z "${JAVA_HOME}" ] ; then
echo "Warning: JAVA_HOME not set!"
# Try to use Bigtop to autodetect JAVA_HOME if it's available
if [ -e /usr/libexec/bigtop-detect-javahome ]; then
. /usr/libexec/bigtop-detect-javahome
elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
. /usr/lib/bigtop-utils/bigtop-detect-javahome
else
JAVA_DEFAULT=`type -p java`
[ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
fi
fi
[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Will McQueen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398163#comment-13398163 ]
Will McQueen commented on FLUME-1154:
-------------------------------------
Thanks for posting the patch, Leslin.
Bruno, I think what you're suggesting makes sense. So if I understand correctly the logic would be something like this:
{code}
#find java
if [ -z "${JAVA_HOME}" ] ; then
echo "Warning: JAVA_HOME not set!"
# Try to use Bigtop to autodetect JAVA_HOME if it's available
if [ -e /usr/libexec/bigtop-detect-javahome ]; then
. /usr/libexec/bigtop-detect-javahome
elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
. /usr/lib/bigtop-utils/bigtop-detect-javahome
fi
# Using java from path if bigtop is not installed or couldn't find it
if [ -z "${JAVA_HOME} ] ; then
JAVA_DEFAULT=`type -p java`
[ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
fi
fi
{code}
Leslin, does this look okay to you?
Cheers,
Will
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Attachment: FLUME-1154_3.patch
Hi, Mike
I changed warning message to be "JAVA_HOME is not set!" in new patch.
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Attachment: FLUME-1154.patch
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Status: Patch Available (was: Open)
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Fix For: v1.2.0
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398160#comment-13398160 ]
Leslin (Hong Xiang Lin) commented on FLUME-1154:
------------------------------------------------
Thank, Bruno
You point main scenario of this JIRA. Because bigtop-detect-javahome only detect java under /usr/lib and /Library, and the first available candidate will be chosen as execute java home randomly. Furthermore, in special environment, if user installed JDK in other path like /home/user but does not set JAVA_HOME as Will described, flume-ng may fail with error saying "Unable to find a suitable JAVA_HOME".
IMHO, is it better to get java from PATH first and then random detect?
Regards
Leslin
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Mike Percy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398850#comment-13398850 ]
Mike Percy commented on FLUME-1154:
-----------------------------------
lgtm, except I'd recommend changing the wording of the warning to "JAVA_HOME is not set"
Regards,
Mike
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Mike Percy (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Percy updated FLUME-1154:
------------------------------
Resolution: Fixed
Status: Resolved (was: Patch Available)
Patch committed. Thanks Leslin!
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch, FLUME-1154_4.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13296133#comment-13296133 ]
Leslin (Hong Xiang Lin) commented on FLUME-1154:
------------------------------------------------
It will be helpful when there are several java (different versions/different distributions) on a machine. According to bigtop-detect-javahome source code, it's only detect several limited directories under /usr/lib and /Library. When user installed java in non above two directory and set java in path without JAVA_HOME, it may replaced by unexpected one.
I add a patch according to Will McQueen suggestion.
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Fix For: v1.2.0
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (FLUME-1154) flume-ng script should first
try finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399374#comment-13399374 ]
Leslin (Hong Xiang Lin) edited comment on FLUME-1154 at 6/22/12 3:16 PM:
-------------------------------------------------------------------------
Hi, Will
Thanks so much for giving me such a good chance!
I updated with your comments. and add patch in review board: https://reviews.apache.org/r/5466/diff/4/
I have already used --no-prefix in previous patches. My command like:
git diff --no-prefix trunk > /home/leslin/flume-patch/FLUME-1154_4.patch
Please feel free to let me know if any more update. Thank you!
Regards
Leslin
was (Author: leslin123):
Hi, Will
Thanks so much for giving me such a good chance!
I updated with your comments. and add patch in review board:
I have already used --no-prefix in previous patches. My command like:
git diff --no-prefix trunk > /home/leslin/flume-patch/FLUME-1154_4.patch
Please feel free to let me know if any more update. Thank you!
Regards
Leslin
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch, FLUME-1154_4.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Bruno Mahé (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398805#comment-13398805 ]
Bruno Mahé commented on FLUME-1154:
-----------------------------------
New patch LGTM.
Thanks Leslin!
Leslin> Regarding Apache Bigtop (incubating) utils behaviour, it will give priority to well known Oracle JDK locations (not at random :) ). But if you want to specify a specific JDK, you can always set your JAVA_HOME in /etc/environment or /etc/default/bigtop-utils
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) reassigned FLUME-1154:
----------------------------------------------
Assignee: Leslin (Hong Xiang Lin)
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Bruno Mahé (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398067#comment-13398067 ]
Bruno Mahé commented on FLUME-1154:
-----------------------------------
The main issue with this approach is that, in most cases openjdk gets pulled for some dependency. But most users want to use Oracle JDK which they install by hand.
If the java from PATH gets used first, then Oracle JDK would never be used automatically.
So what about doing the following:
if JAVA_HOME is not defined, it tries to use bigtop-detect-javahome. If bigtop-detect-javahome still does not find anything, then it will try to use the java from the PATH.
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398022#comment-13398022 ]
Leslin (Hong Xiang Lin) commented on FLUME-1154:
------------------------------------------------
Patch is available, and link for review: https://reviews.apache.org/r/5466/diff/#index_header
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400150#comment-13400150 ]
Hudson commented on FLUME-1154:
-------------------------------
Integrated in flume-trunk #252 (See [https://builds.apache.org/job/flume-trunk/252/])
FLUME-1154. Improve how JAVA_HOME is found at startup time.
(Leslin (Hong Xiang Lin) via Mike Percy) (Revision 1353256)
Result = UNSTABLE
mpercy : http://svn.apache.org/viewvc/?view=rev&rev=1353256
Files :
* /incubator/flume/trunk/bin/flume-ng
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch, FLUME-1154_4.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Attachment: FLUME-1154_1.patch
Delete a needless space
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Will McQueen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399102#comment-13399102 ]
Will McQueen commented on FLUME-1154:
-------------------------------------
Hi Leslin,
Thank you for the patch updates! :-)
A few nits...
1) Could you please create the patch with "git --no-prefix" so that the patch file content doesn't show "a/..." and "b/..." (eg, it's currently showing "diff --git a/bin/flume-ng b/bin/flume-ng").
2) Could you please upload the new patch to reviewboard?
3) With the new logic, this line is no longer relevant and can be removed:
[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
4) Could you please use the new-style format, to change this:
JAVA_DEFAULT=`type -p java`
...into this:
JAVA_DEFAULT=$(type -p java)
(the new style format is used in other places within the script... this is the only place where the old style is used)
Cheers,
Will
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Attachment: FLUME-1154_2.patch
Hi, Will
Thanks so much for your quick response. That's fine, it can resolve this problem. Thanks Will and Bruno.
I update patch with your suggestion and test this script. I changed change: echo "Warning: JAVA_HOME not set!" to warn "JAVA_HOME does not set!" and "${JAVA_HOME} to "${JAVA_HOME}"
Will, you can change owner to you as you provide the final implementation. :-)
Regard
Leslin
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (FLUME-1154) flume-ng script should first try
finding java from PATH and then try using bigtop, instead of vice-versa
Posted by "Leslin (Hong Xiang Lin) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLUME-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leslin (Hong Xiang Lin) updated FLUME-1154:
-------------------------------------------
Attachment: FLUME-1154_4.patch
Hi, Will
Thanks so much for giving me such a good chance!
I updated with your comments. and add patch in review board:
I have already used --no-prefix in previous patches. My command like:
git diff --no-prefix trunk > /home/leslin/flume-patch/FLUME-1154_4.patch
Please feel free to let me know if any more update. Thank you!
Regards
Leslin
> flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa
> --------------------------------------------------------------------------------------------------------
>
> Key: FLUME-1154
> URL: https://issues.apache.org/jira/browse/FLUME-1154
> Project: Flume
> Issue Type: Bug
> Components: Shell
> Affects Versions: v1.2.0
> Reporter: Will McQueen
> Assignee: Leslin (Hong Xiang Lin)
> Fix For: v1.2.0
>
> Attachments: FLUME-1154.patch, FLUME-1154_1.patch, FLUME-1154_2.patch, FLUME-1154_3.patch, FLUME-1154_4.patch
>
>
> Please see bin/flume-ng script, under the "#find java" section.
> It says:
> # find java
> if [ -z "${JAVA_HOME}" ] ; then
> echo "Warning: JAVA_HOME not set!"
> # Try to use Bigtop to autodetect JAVA_HOME if it's available
> if [ -e /usr/libexec/bigtop-detect-javahome ]; then
> . /usr/libexec/bigtop-detect-javahome
> elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
> . /usr/lib/bigtop-utils/bigtop-detect-javahome
> else
> JAVA_DEFAULT=`type -p java`
> [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
> JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
> fi
> fi
> [ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
> ...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
> So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira