From owner-freebsd-questions Tue Oct 1 3:32:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2DACE37B401 for ; Tue, 1 Oct 2002 03:32:37 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D752A43E42 for ; Tue, 1 Oct 2002 03:32:35 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id g91AWYOL090183; Tue, 1 Oct 2002 11:32:34 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id g91AWTIi090178; Tue, 1 Oct 2002 11:32:29 +0100 (BST) Date: Tue, 1 Oct 2002 11:32:29 +0100 From: Matthew Seaman To: Lee Gold Cc: freebsd-questions@FreeBSD.ORG Subject: Re: unix locate cmd Message-ID: <20021001103229.GA89674@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , Lee Gold , freebsd-questions@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-Spam-Status: No, hits=-9.9 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT, USER_AGENT_MUTT version=2.41 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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