etclocate.rc


/etc/locate.rc

The locate(1) program finds all files of a given name. For example, to find any files with the string "mozilla" in their name, run this command:

 # locate mozilla /usr/ports/www/mozilla /usr/ports/www/mozilla/CVS ... 

You'll see that many files include the string "mozilla" in their path, all under the directory /usr/ports/www/mozilla.

Once a week, your OpenBSD fires up the script /usr/libexec/ locate.updatedb, which scans the system's disks, builds a list of everything it finds, and stores that list in a database. The list-building program uses the values contained in /etc/locate.rc to determine which directories and file systems to scan.

Two values that control how the search works are SEARCHPATHS and FILESYSTEMS. SEARCHPATHS is usually set to "/", so that the entire system is scanned. If you want to search only a subsection of the system, you could change this to another directory. This would seriously alter locate(1)'s expected behavior and is not recommended. FILESYSTEMS, on the other hand, lists the type of file systems that locate.updatedb scans. It defaults to searching only FFS and UFS, but if you have a multiboot system you might want to list your foreign file systems here as well. After all, the ability to locate(1) your MP3 collection on your Windows slice is a vital system function. On the other hand, listing NFS file systems can be dangerous; if all of your clients start searching your central NFS server at the same time, performance will be poor.

The only caveat with these two variables is that SEARCHPATHS must be a directory on a file system listed in FILESYSTEMS; if you give a SEARCHPATH that's on a file system that isn't in FILESYSTEMS, the locate(1) database will be empty.

You might also want to exclude directories from the locate update. The PRUNEPATHS variable includes the directories you don't want checked. This defaults to the standard temporary directories.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net