From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13667 invoked from network); 5 Sep 1997 23:42:53 -0000 Received: from math.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 5 Sep 1997 23:42:53 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id TAA15476; Fri, 5 Sep 1997 19:35:46 -0400 (EDT) Resent-Date: Fri, 5 Sep 1997 19:35:46 -0400 (EDT) Message-ID: From: Amol Deshpande To: ZSH mailing list , "'Mark Borges'" Subject: RE: [list abuse] bug in /bin/csh and /usr/local/bin/tcsh? Date: Fri, 5 Sep 1997 15:00:33 -0700 X-Priority: 3 X-Mailer: Internet Mail Service (5.0.1459.27) Resent-Message-ID: <"I9cYx2.0.ln3.HT94q"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3480 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu It looks like this is done to get the current working directory on certain sysv systems. lstat of every dir in the root seems to kick in when the shell is invoked from a device different from the root paritition. this is just from a cursory glance at the source, and I don't know anything about system v. caveat emptor etc. etc. perhaps they are working around an old bug in the getwd() call ? -amol > ---------- > From: Mark Borges[SMTP:mdb@cdc.noaa.gov] > Sent: Friday, September 05, 1997 1:16 PM > To: ZSH mailing list > Subject: [list abuse] bug in /bin/csh and /usr/local/bin/tcsh? > > This is certainly not a zsh bug, but since this list has many members > who know far more about the internals of shells than I, I thought it > would be a good forum. > > Q: Why do /bin/csh and /usr/local/bin/tcsh, as part of their startup > process, do an lstat of every directory in the root partition where > the shell was invoked? > > For instance, > > $ truss /bin/csh -c 'echo foobar' |& grep /archive > lstat("./../archive", 0xEFFFC400) = 0 > $ truss /usr/local/bin/tcsh -c 'echo foobar' |& grep /archive > lstat("../archive", 0xEFFFE308) = 0 > $ truss /bin/sh -c 'echo foobar' |& grep /archive > $ truss /usr/local/bin/zsh -c 'echo foobar' |& grep /archive > $ truss /bin/ksh -c 'echo foobar' |& grep /archive > $ uname -a > SunOS solberg 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-2 > $ > > (Note that zsh, sh, and ksh do not do the lstat. archive is a mount > point in / for an NFS mounted partition. The script was invoked in a > subdirectory of /). > > Ordinarily, this is not a big problem. But, one of our users has many > /bin/csh scripts in his crontab, and when /archive is inaccessible > (it's a jukebox filesystem that is *very* flaky) his /bin/csh cronjobs > hang and fail to execute. > > As a potential workaround, we've NFS mounted this volume read-only and > soft-mounted (it was rw and hard mounted) in the hope that the shell > will at least start up and execute the script (which has nothing to do > with /archive). Or will this fail, too? > > Any comments or other suggested work-arounds are most welcome. I've > tried "don't write scripts in /bin/csh!", but that falls on deaf ears > ;-). > > -- > -mb- >