Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Sep 1995 14:41:34 -0500 (CDT)
From:      Mike Pritchard <mpp@mpp.minn.net>
To:        freebsd-questions@freebsd.org
Subject:   odd behavior of find
Message-ID:  <199509091941.OAA11714@mpp.minn.net>

next in thread | raw e-mail | index | archive | help
In my /etc/weekly script, I issue the following command to find
any core files that may be laying around:

echo ""
echo "Checking for core files"
find / -fstype local -name core -o -name "*.core" -ls

After doing some work on the fdesc file system, I left a
fdesc file system mounted at /fd.  There is a comment in
the fdesc code that says it doesn't set the MNT_LOCAL flag 
for the file system to work around a bug in fts() (which find
uses).  Fine.  Except that "find" is still descending into the 
file system and getting an error - "find: 6: Bad file descriptor".
If I unmount /fd, the problem goes away.

Mount correctly shows that fdesc is not a "local" file system,

/dev/sd1a on / (local)
/dev/sd1f on /usr (local, with quotas)
/dev/sd2a on /usr/var (local, with quotas)
procfs on /proc (local)
kernfs on /kern (local)
fdesc on /fd

I tried looking at find, but got a headache trying to figure out
exactly how the -fstype option works.  Removing the "-fstype local" 
also makes the error disappear.  Does anyone have any ideas why
the "-fstype local" option is behaving this way?

Here is the output from /etc/weekly:

> Checking for core files
> find: 6: Bad file descriptor
> 55928  416 -rw-------    1 root     mpp        200704 Sep  6 10:53 /usr/home/mpp/src/fsdb/fsdb.core
> 8222  544 -rw-------    1 root     wheel      266240 Sep  2 12:05 /var/cron/cron.core
-- 
Mike Pritchard
mpp@mpp.minn.net
"Go that way.  Really fast.  If something gets in your way, turn"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509091941.OAA11714>