You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by charlie w <sp...@gmail.com> on 2007/07/18 18:15:10 UTC

It seems the hadoop start scripts broken under cygwin and Fedora Core

Specifically this:

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

. "$bin"/hadoop-config.sh

The problem is that the 'cd' command on cygwin and Fedora is not silent, so
if one tries:

bin/hadoop namenode format

one winds up with this output:

bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
/home/charlie/bin/hadoop-config.sh: No such file or directory

It appears that simply adding >/dev/null to the cd command fixes things:

 bin=`cd "$bin" > /dev/null; pwd`

Re: It seems the hadoop start scripts broken under cygwin and Fedora Core

Posted by Briggs <ac...@gmail.com>.
Which version are you using?   I am using 0.13.0 and have had no
problems with Cygwin or CentOS (RedHat).



On 7/18/07, charlie w <sp...@gmail.com> wrote:
> Specifically this:
>
> bin=`dirname "$0"`
> bin=`cd "$bin"; pwd`
>
> . "$bin"/hadoop-config.sh
>
> The problem is that the 'cd' command on cygwin and Fedora is not silent, so
> if one tries:
>
> bin/hadoop namenode format
>
> one winds up with this output:
>
> bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
> /home/charlie/bin/hadoop-config.sh: No such file or directory
>
> It appears that simply adding >/dev/null to the cd command fixes things:
>
>  bin=`cd "$bin" > /dev/null; pwd`
>


-- 
"Conscious decisions by conscious minds are what make reality real"

Re: It seems the hadoop start scripts broken under cygwin and Fedora Core

Posted by Briggs <ac...@gmail.com>.
Well, if cd were aliased a 'which cd' would have immediately told you. :-)



On 7/18/07, charlie w <sp...@gmail.com> wrote:
> Whoa yeah, nice catch indeed; I would never have thought of that.
>
> It turns out that's not the issue at all, but that suggestion pointed me in
> the right direction.
>
> A few things to note here...
> Thing 1: 'which cd' doesn't help because cd is a builtin, and so you get the
> "which: no cd in (..." result.
> Thing 2: Because I typically don't use '-x' in my alias commands, the hadoop
> script doesn't inherit my shell aliases.  I verified this by adding an
> 'alias -p' to the hadoop script, and the script has no aliases for anything.
>
> Thing 3: If the CDPATH environment variable exists, and the path is
> ambiguous, the cd command is *not* silent, aliased or not.  It will print
> the dir it chose to cd to.  In my case, there were 2 'bin' possibilities in
> my CDPATH.
>
> So I'm going to unset my CDPATH, since I never really make use of it for
> anything.  I forgot it was set, and probably would have been pretty
> surprised when it would actually have had an effect.
>
> I know this kind of thing is incredibly difficult to accomodate, but
> perhaps having the hadoop scripts deal with the potential output from cd
> might be worthwhile.
>
> Thanks for the tips,
> C
>
>
>
> On 7/18/07, Briggs <ac...@gmail.com> wrote:
> >
> > Good call Ted.  I guess a 'which cd' might help to find out.
> >
> >
> > On 7/18/07, Ted Dunning < tdunning@veoh.com> wrote:
> > >
> > > It sounds to me like you have somehow aliased cd.  This may be due to a
> > > sysadmin being too clever or due to your own profile.  Needless to say,
> > this
> > > is really bad practice.
> > >
> > > Here is what I see on Redhat:
> > >
> > > -bash-3.00$ cd /tmp
> > > -bash-3.00$
> > >
> > > (no output from cd)
> > >
> > >
> > > On 7/18/07 9:15 AM, "charlie w" < spambait132@gmail.com > wrote:
> > >
> > > > Specifically this:
> > > >
> > > > bin=`dirname "$0"`
> > > > bin=`cd "$bin"; pwd`
> > > >
> > > > . "$bin"/hadoop-config.sh
> > > >
> > > > The problem is that the 'cd' command on cygwin and Fedora is not
> > silent, so
> > > > if one tries:
> > > >
> > > > bin/hadoop namenode format
> > > >
> > > > one winds up with this output:
> > > >
> > > > bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
> > > > /home/charlie/bin/hadoop-config.sh: No such file or directory
> > > >
> > > > It appears that simply adding >/dev/null to the cd command fixes
> > things:
> > > >
> > > >  bin=`cd "$bin" > /dev/null; pwd`
> > >
> > >
> >
> >
> > --
> > "Conscious decisions by conscious minds are what make reality real"
> >
>


-- 
"Conscious decisions by conscious minds are what make reality real"

Re: It seems the hadoop start scripts broken under cygwin and Fedora Core

Posted by charlie w <sp...@gmail.com>.
Whoa yeah, nice catch indeed; I would never have thought of that.

It turns out that's not the issue at all, but that suggestion pointed me in
the right direction.

A few things to note here...
Thing 1: 'which cd' doesn't help because cd is a builtin, and so you get the
"which: no cd in (..." result.
Thing 2: Because I typically don't use '-x' in my alias commands, the hadoop
script doesn't inherit my shell aliases.  I verified this by adding an
'alias -p' to the hadoop script, and the script has no aliases for anything.

Thing 3: If the CDPATH environment variable exists, and the path is
ambiguous, the cd command is *not* silent, aliased or not.  It will print
the dir it chose to cd to.  In my case, there were 2 'bin' possibilities in
my CDPATH.

So I'm going to unset my CDPATH, since I never really make use of it for
anything.  I forgot it was set, and probably would have been pretty
surprised when it would actually have had an effect.

I know this kind of thing is incredibly difficult to accomodate, but
perhaps having the hadoop scripts deal with the potential output from cd
might be worthwhile.

Thanks for the tips,
C



On 7/18/07, Briggs <ac...@gmail.com> wrote:
>
> Good call Ted.  I guess a 'which cd' might help to find out.
>
>
> On 7/18/07, Ted Dunning < tdunning@veoh.com> wrote:
> >
> > It sounds to me like you have somehow aliased cd.  This may be due to a
> > sysadmin being too clever or due to your own profile.  Needless to say,
> this
> > is really bad practice.
> >
> > Here is what I see on Redhat:
> >
> > -bash-3.00$ cd /tmp
> > -bash-3.00$
> >
> > (no output from cd)
> >
> >
> > On 7/18/07 9:15 AM, "charlie w" < spambait132@gmail.com > wrote:
> >
> > > Specifically this:
> > >
> > > bin=`dirname "$0"`
> > > bin=`cd "$bin"; pwd`
> > >
> > > . "$bin"/hadoop-config.sh
> > >
> > > The problem is that the 'cd' command on cygwin and Fedora is not
> silent, so
> > > if one tries:
> > >
> > > bin/hadoop namenode format
> > >
> > > one winds up with this output:
> > >
> > > bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
> > > /home/charlie/bin/hadoop-config.sh: No such file or directory
> > >
> > > It appears that simply adding >/dev/null to the cd command fixes
> things:
> > >
> > >  bin=`cd "$bin" > /dev/null; pwd`
> >
> >
>
>
> --
> "Conscious decisions by conscious minds are what make reality real"
>

Re: It seems the hadoop start scripts broken under cygwin and Fedora Core

Posted by Briggs <ac...@gmail.com>.
Good call Ted.  I guess a 'which cd' might help to find out.


On 7/18/07, Ted Dunning <td...@veoh.com> wrote:
>
> It sounds to me like you have somehow aliased cd.  This may be due to a
> sysadmin being too clever or due to your own profile.  Needless to say, this
> is really bad practice.
>
> Here is what I see on Redhat:
>
> -bash-3.00$ cd /tmp
> -bash-3.00$
>
> (no output from cd)
>
>
> On 7/18/07 9:15 AM, "charlie w" <sp...@gmail.com> wrote:
>
> > Specifically this:
> >
> > bin=`dirname "$0"`
> > bin=`cd "$bin"; pwd`
> >
> > . "$bin"/hadoop-config.sh
> >
> > The problem is that the 'cd' command on cygwin and Fedora is not silent, so
> > if one tries:
> >
> > bin/hadoop namenode format
> >
> > one winds up with this output:
> >
> > bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
> > /home/charlie/bin/hadoop-config.sh: No such file or directory
> >
> > It appears that simply adding >/dev/null to the cd command fixes things:
> >
> >  bin=`cd "$bin" > /dev/null; pwd`
>
>


-- 
"Conscious decisions by conscious minds are what make reality real"

Re: It seems the hadoop start scripts broken under cygwin and Fedora Core

Posted by Ted Dunning <td...@veoh.com>.
It sounds to me like you have somehow aliased cd.  This may be due to a
sysadmin being too clever or due to your own profile.  Needless to say, this
is really bad practice.

Here is what I see on Redhat:

-bash-3.00$ cd /tmp
-bash-3.00$ 

(no output from cd)


On 7/18/07 9:15 AM, "charlie w" <sp...@gmail.com> wrote:

> Specifically this:
> 
> bin=`dirname "$0"`
> bin=`cd "$bin"; pwd`
> 
> . "$bin"/hadoop-config.sh
> 
> The problem is that the 'cd' command on cygwin and Fedora is not silent, so
> if one tries:
> 
> bin/hadoop namenode format
> 
> one winds up with this output:
> 
> bin/hadoop: line 22: /home/charlie/hadoop-0.13.0/bin
> /home/charlie/bin/hadoop-config.sh: No such file or directory
> 
> It appears that simply adding >/dev/null to the cd command fixes things:
> 
>  bin=`cd "$bin" > /dev/null; pwd`