Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 11:32:29 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Lee Gold <goldtech@worldpost.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: unix locate cmd
Message-ID:  <20021001103229.GA89674@happy-idiot-talk.infracaninophi>
In-Reply-To: <E17wK6C-0007P5-00@smtp03.mrf.mail.rcn.net>
References:  <E17wK6C-0007P5-00@smtp03.mrf.mail.rcn.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 01, 2002 at 06:18:25AM -0500, Lee Gold wrote:
> I'm trying to use the  locate  cmd to find all
> instances of .xinitrc in my system. I did,
> 
> root#  /usr/libexec/locate.unpdatedb
> root# setenv $LOCATE_PATH /var/db/locate.database
> 
> I've tried  root# locate "filename"
> with different input but the command gives no
> feedback or output - it just goes to a new prompt.
> and of course,
> # locate .xinitrc  or \.initrc or anything else gives no
> out from the cmd. what am I doing wrong?

Try using the /etc/periodic/weekly/310.locate script.  That script is
run once a week by default, so you should already have had a valid
locate.database if your system had been up at 4.15am on a Saturday.

If you look at the 310.locate script you can see one vitally important
point: it runs locate.updatedb as the unprivileged user "nobody" ---
that's a very important security feature.  Note that the
locate.database file should be owned by the "nobody" user:

    happy-idiot-talk:~:% ls -la /var/db/locate.database
    -r--r--r--  1 nobody  wheel  1410147 Sep 28 04:15 /var/db/locate.database

Your command to set the LOCATE_PATH environment variable is:

    a) not required --- locate is already set up to use
    /var/db/locate.database by default

and

    b) incorrectly specified.  You should have typed:

        setenv LOCATE_PATH /var/db/locate.database

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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