From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 15 11:45:03 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA2E3BA4 for ; Thu, 15 Nov 2012 11:45:03 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 569B38FC0C for ; Thu, 15 Nov 2012 11:45:02 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TYxsW-0007ul-AU for freebsd-hackers@freebsd.org; Thu, 15 Nov 2012 12:45:04 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Nov 2012 12:45:04 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Nov 2012 12:45:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Subject: Re: Give users a hint when their locate database is too small. Date: Thu, 15 Nov 2012 12:43:55 +0100 Lines: 65 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig09F4CC78D9BDE9AE0890B4B4" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120812 Thunderbird/14.0 In-Reply-To: X-Enigmail-Version: 1.4.3 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 11:45:03 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig09F4CC78D9BDE9AE0890B4B4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 13/11/2012 04:07, Eitan Adler wrote: > What do people think of this? Maybe /usr/libexec/locate.updatedb is a > better pointer? =2E.. or, make it automagical by adding a rc.d script which will test the= database exists (or is "too small") and start locate.updatedb as a background / detached process? Orthogonal to that, I'm always surprise by how fast Linux's updatedb is. I don't know if it is due to file system differences or some fundamental differences (incremental updates?), but updatedb on Linux usually takes 1-3 seconds, while on FreeBSD it is 10-120 seconds. > commit fb03b777daf2c69bb9612902e38fdb25b256be72 > Author: Eitan Adler > Date: Mon Nov 12 22:05:55 2012 -0500 >=20 > Give users a hint when their locate database is too small. >=20 > Reviwed by: ??? > Approved by: ??? > MFC after: 3 weeks >=20 > diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/loc= ate.c > index b0faefb..f0c8c37 100644 > --- a/usr.bin/locate/locate/locate.c > +++ b/usr.bin/locate/locate/locate.c > @@ -292,7 +292,7 @@ search_mmap(db, s) > err(1, "`%s'", db); > len =3D sb.st_size; > if (len < (2*NBG)) > - errx(1, "database too small: %s", db); > + errx(1, "database too small: %s\nTry running > /etc/periodic/weekly/310.locate", db); >=20 > if ((p =3D mmap((caddr_t)0, (size_t)len, > PROT_READ, MAP_SHARED, >=20 >=20 --------------enig09F4CC78D9BDE9AE0890B4B4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlCk1XsACgkQ/QjVBj3/HSy1zACglc4uBDxpT+44uR0cDg7BVXSG JNIAoJkfXsC84LutQ3rnoH/2OlrjYgoY =5YYu -----END PGP SIGNATURE----- --------------enig09F4CC78D9BDE9AE0890B4B4--