makewhatis / updatedb
Rick Stevens
rstevens at vitalstream.com
Tue Jun 29 19:14:54 UTC 2004
Bob McClure Jr wrote:
> On Tue, Jun 29, 2004 at 09:37:16AM -0700, Rick Stevens wrote:
>
>><snip>
>>
>>makewhatis and updatedb have nothing to do with each other. makewhatis
>>generates the database for the "man -k" or "appropos" commands, updatedb
>>generates the database for the "which" and "whereis" commands.
>
>
> Umm, if I may dare correct our otherwise duly esteemed guru, updatedb
> generates the database for the "locate" command. "which" merely looks
> for a command in your $PATH, and "whereis" (according to the man page)
> looks in a few hardwired places for the binary, man page, and source
> for something. If either of them use the locate database, it's not
> well documented.
You are quite correct. I forgot that I've aliased a number of my
commands and whereis actually runs the original whereis followed by an
slocate if whereis doesn't come up with anything.
The scientific word for my error is "Doh!" :-p
>>>What can cause updatedb to continue running and not finish? Could it be
>>>the NFS filesystems? They've been mounted for months with no problems.
>>
>>It could be. You may have a recursive directory loop or something in
>>there.
>>
>>It depends on what changed on the filesystems it's checking. You may
>>need to use the "-e" option to exclude certain directories or the "-f"
>>option to exclude filesytem types, e.g.
>>
>> updatedb -f nfs
>>
>>to exclude NFS volumes.
>
>
> My system (up to FC1, now) has a default /etc/updatedb.conf which
> says:
>
> PRUNEFS="devpts NFS nfs afs sfs proc smbfs autofs auto iso9660"
> PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /net /sfs"
> export PRUNEFS
> export PRUNEPATHS
>
> which, I think, excludes NFS mounts by default. No?
It would provided you modified the /etc/cron.daily/slocate.cron file
to use the environment variables. My file has the exclusions hard-coded
in it as "-e" and "-f" options.
Technically, updatedb is a symlink to slocate. slocate, if called as
updatedb, assumes the "-u" flag. If you want it to read the
/etc/updatedb.conf file, it must also be passed the "-c" flag. On top
of that, the format of the "-f" and "-e" options are comma-separated,
not space-separated. Unless slocate reads those specific environment
variables, my guess is that that file is just noise.
A quick run through man, info and the slocate README reveals nothing
about that, nor is there anything on the proper format of
/etc/updatedb.conf--which is just a shell script that exports some
variables.
> I'm sorry. I've done nothing to explain Karl's anomoly.
Neither do I. Perhaps a run of updatedb with the "-v" flag might
reveal what's going on:
/usr/bin/updatedb -v -f "nfs,smbfs,ncpfs,proc,devpts" -e \
"/tmp,/var/tmp,/usr/tmp,/afs,/net"
>>- Careful! Ugly strikes 9 out of 10 people! -
>
> And senility gets the rest of us. :-)
I'm sure I could come up with a snappy rejoinder, but I just can't
remember who the hell you are! ;-)
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer rstevens at vitalstream.com -
- VitalStream, Inc. http://www.vitalstream.com -
- -
- A day for firm decisions!!! Well, then again, maybe not! -
----------------------------------------------------------------------
More information about the Redhat-install-list
mailing list