Date: Thu, 15 Nov 2012 12:43:55 +0100 From: Ivan Voras <ivoras@freebsd.org> To: freebsd-hackers@freebsd.org Subject: Re: Give users a hint when their locate database is too small. Message-ID: <k82khq$g3m$1@ger.gmane.org> In-Reply-To: <CAF6rxgkXXmSsoPHNVe6RLGpQ1C-qUq_y4YQSo3YgPhAeTdJAyQ@mail.gmail.com> References: <CAF6rxgkXXmSsoPHNVe6RLGpQ1C-qUq_y4YQSo3YgPhAeTdJAyQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 13/11/2012 04:07, Eitan Adler wrote: > What do people think of this? Maybe /usr/libexec/locate.updatedb is a > better pointer? ... 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 <lists@eitanadler.com> > Date: Mon Nov 12 22:05:55 2012 -0500 > > Give users a hint when their locate database is too small. > > Reviwed by: ??? > Approved by: ??? > MFC after: 3 weeks > > diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.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 = 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); > > if ((p = mmap((caddr_t)0, (size_t)len, > PROT_READ, MAP_SHARED, > > [-- Attachment #2 --] -----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?k82khq$g3m$1>
