Re: Bug, feature or just the correct behaviour (stat'ing -bash down the PATH)

2015-06-03 Thread Dave Rutherford
On Tue, Jun 2, 2015 at 9:08 AM, Wheatley, Martin R <
martin.wheat...@ccfe.ac.uk> wrote:
> a truss of "bash -ls" shows it stat'ing '-bash' in each of the directories
> in PATH...
>
> 11933:  stat64("/usr/bin/-bash", 0xFFBFEBE8)Err#2 ENOENT
> 11933:  stat64("/usr/sbin/-bash", 0xFFBFEBE8)   Err#2 ENOENT
> 11933:  stat64("/usr/dt/bin/-bash", 0xFFBFEBE8) Err#2 ENOENT
> 11933:  stat64("/home/USER/bin/-bash", 0xFFBFEBE8)  Err#2 ENOENT
>
> Why does bash do all these 'stat()' system calls? We tried providing an
> executable '-bash' at one of the locations but it didn't appear to have
> any effect.

I believe this is bash trying to set the BASH environment variable.
You say creating a file `-bash' has no effect, but how would
stat return ENOENT if there were a file `/usr/bin/-bash'?
If this is on the local machine, it should be searched (and found)
before any NFS directories are checked. What other
consequences this might have I'm not sure. I don't think bash
uses BASH for anything.

Could you send a truss of the case where /usr/bin/-bash
exists and is executable?

> If one of the directories in the PATH is on an NFS server that is
> 'down' then bash hangs - which disables a shell which would otherwise
> be usable.

It is ironic yet somehow appropriate that a fusion energy center
should be having such a 1997 sort of problem today.  But
truly, my sympathies. :-)

Dave


Re: Bug, feature or just the correct behaviour (stat'ing -bash down the PATH)

2015-06-03 Thread Dennis Williamson
On Tue, Jun 2, 2015 at 5:47 PM, Dave Rutherford 
wrote:

>
> It is ironic yet somehow appropriate that a fusion energy center
> should be having such a 1997 sort of problem today.  But
> truly, my sympathies. :-)
>
> Dave
>

How about a nuclear plant having a '70s kind of problem?

https://ca.linkedin.com/jobs2/view/28135735

-- 
Visit serverfault.com to get your system administration questions answered.