Subject: Re: when to run makewhatis
To: None <email@example.com>
From: Valeriy E. Ushakov <firstname.lastname@example.org>
Date: 01/21/2007 02:27:02
Jeremy C. Reed <email@example.com> wrote:
> On Sat, 20 Jan 2007, Blair Sadewitz wrote:
>> I have often wondered why this is not run periodically myself.
>> Perhaps this is best handled by an option in rc.conf?
> I'll use weekly.conf.
> If nobody objects, I'll commit this in a couple days:
> Index: weekly
> RCS file: /cvsroot/src/etc/weekly,v
> retrieving revision 1.21
> diff -u -r1.21 weekly
> --- weekly 12 Nov 2006 01:22:57 -0000 1.21
> +++ weekly 20 Jan 2007 16:39:23 -0000
> @@ -79,6 +79,16 @@
> +if checkyesno rebuild_whatisdb; then
> + echo ""
> + if `whatis whatis 2>/dev/null >/dev/null` ; then
> + echo "Rebuilding whatis databases:"
> + nice -n 5 /usr/libexec/makewhatis -f
> + else
> + echo "Not rebuilding whatis databases"
> + fi
> if [ -f /etc/weekly.local ]; then
> . /etc/weekly.local > $TMP 2>&1
> if [ -s $TMP ] ; then
> Index: defaults/weekly.conf
> RCS file: /cvsroot/src/etc/defaults/weekly.conf,v
> retrieving revision 1.2
> diff -u -r1.2 weekly.conf
> --- defaults/weekly.conf 8 Nov 2000 23:17:50 -0000 1.2
> +++ defaults/weekly.conf 20 Jan 2007 16:39:23 -0000
> @@ -11,3 +11,4 @@
I have my doubts about it.
As I've already said, /usr/share and /usr/X11R6 are not supposed to be
touched, so they just don't need whatis update ever, they will get it
when new sets are installed.
Even if we are clever and exclude the constant "system" dirs, what
happens in an envronment where /usr/pkg is shared across multiple
machines? You end up wasting cycles on each machine, though,
admittedly, even my old 50MHz sparc only takes 6 minutes to do
makewhatis on /usr/pkg/man with a few dozens of packages.
Also, judging from a quick glance, there's a bug in makewhatis - you
can hit unlink+fopen race in makewhatis() and get two machines doing
dumpwhatis() into the same file.
An interesting question is if there's a nice way to integrate
catman/makewhatis into pkgsrc. I tend to run catman on /usr/pkg/man
on my slower machines regularly b/c it just takes too long to format
man pages on demand each time. If a package is deleted the orphaned
cat pages are left, as they are not in PLIST.
In general our catman and makewhatis could use some improvements but I
don't want to go into this rant now, as I haven't really thought about
all the ramifications.
firstname.lastname@example.org | Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen