You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2010/03/12 01:56:27 UTC

[jira] Created: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
----------------------------------------------------------------------------

                 Key: HADOOP-6630
                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Allen Wittenauer


If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844332#action_12844332 ] 

Hadoop QA commented on HADOOP-6630:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12438560/HADOOP-6630.txt
  against trunk revision 921980.

    +1 @author.  The patch does not contain any @author tags.

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h1.grid.sp2.yahoo.net/35/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h1.grid.sp2.yahoo.net/35/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h1.grid.sp2.yahoo.net/35/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h1.grid.sp2.yahoo.net/35/console

This message is automatically generated.

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

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

Allen Wittenauer updated HADOOP-6630:
-------------------------------------

    Attachment: HADOOP-6630.txt

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Allen Wittenauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844555#action_12844555 ] 

Allen Wittenauer commented on HADOOP-6630:
------------------------------------------

For such a simple change, I doubt tests are required. :)

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Allen Wittenauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862448#action_12862448 ] 

Allen Wittenauer commented on HADOOP-6630:
------------------------------------------

Can we get this committed prior to the 0.21 freeze please? :)

Thank you. :)

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

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

Allen Wittenauer updated HADOOP-6630:
-------------------------------------

    Status: Patch Available  (was: Open)

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

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

Allen Wittenauer updated HADOOP-6630:
-------------------------------------

    Affects Version/s: 0.20.2

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

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

Tom White updated HADOOP-6630:
------------------------------

           Status: Resolved  (was: Patch Available)
     Hadoop Flags: [Reviewed]
         Assignee: Allen Wittenauer
    Fix Version/s: 0.21.0
       Resolution: Fixed

I've just committed this. Thanks Allen!

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>             Fix For: 0.21.0
>
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Allen Wittenauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844305#action_12844305 ] 

Allen Wittenauer commented on HADOOP-6630:
------------------------------------------

Since we require bash, we can cheat a bit. BASH_SOURCE should contain the full path to the script that we are executing. This means we can piggyback off of that variable to figure out where our real landing path is at.

> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Allen Wittenauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844639#action_12844639 ] 

Allen Wittenauer commented on HADOOP-6630:
------------------------------------------

Actually, I misspoke a bit. It will be full path if it comes from $PATH.  If you call with a relative path, it will contain the relative path.

So to be more explicit:

if I put this code:

{code}
#!/bin/bash
echo $BASH_SOURCE
{code}

in $HOME/bin and make sure $HOME/bin is in my path, you'll see the following:

awittena-mn:bin awittena$ testexec
/Users/awittena/bin/testexec

awittena-mn:~ awittena$ bin/testexec
bin/testexec

awittena-mn:~ awittena$ cd bin && testexec
/Users/awittena/bin/testexec

awittena-mn:~ awittena$ cd bin && ./testexec
./testexec

So the cd+pwd combo is still needed, but this should fix the "in the $PATH" issue.  It is a shame that bash hid the "can't find hadoop-config.sh" error for the past few years.  If you run it with -x set, you'll see it tho.


> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844667#action_12844667 ] 

Doug Cutting commented on HADOOP-6630:
--------------------------------------

Sounds reasonable.  Thanks for the explanation.  +1 from me.


> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6630) hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844619#action_12844619 ] 

Doug Cutting commented on HADOOP-6630:
--------------------------------------

Allen, if BASH_SOURCE contains the full path, then can we get rid of the 'bin=`cd "$bin"; pwd`' that follows each of these, since the point of that is to get the full path of the bin directory?


> hadoop-config.sh fails to get executed if hadoop wrapper scripts are in path
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-6630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6630
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.2
>            Reporter: Allen Wittenauer
>         Attachments: HADOOP-6630.txt
>
>
> If the hadoop/bin commands are in the path, hadoop-config.sh doesn't executed until much later in the stack because $0 lacks a path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.