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 [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to