[CLUE-Tech] man -k stopped working

Jed S. Baer thag at frii.com
Fri Nov 22 22:04:56 MST 2002


On Fri, 22 Nov 2002 21:49:29 -0700
"Timothy C. Klein" <teece at silverklein.net> wrote:

> > > Sure. Funny thing here, I looked again at makewhatis, and noticed it
> > > uses a "find {...} -newer /var/cache/man/whatis", I'm guessing when
> > > the"-u" flag is specified. That would make sense. So I ran it as
> > > "makewhatis -w", and all is OK. That leaves the question of what
> > > catted/dev/null to that file. Can't reproduce the error now. But,
> > > something created an empty/var/cache/man/whatis file, and since
> > > nothing changed thereafter (WRT man pages), it just stayed empty.
> > 
> > This has happened again. Any thoughts on how to pinpoint what process
> > is truncating the /var/cache/man/whatis file? I guess I'll have to
> > grep the sysinit scripts, but otherwise, how do I find out what's
> > doing this?
> 
> Well, just ask the NSA/CIA/FBI, they know everything that happens on
> every computer, don't they? 
> 
> Sorry, bad joke.

Wish I had an equally bad riposte.

> You could write a little script to check the inode of
...
> LSOF gives you a list of all the open files, with associated processes.
> You could probalby write a script that pipes LSOF to a file, checks to

Yeah, my "Oracle" brain wishes there were a way to attach a "trigger" to
the file, such that it executes anytime the file gets accessed.

The only headway I've made so far is ruling out any of the init scripts.
AFAICT, it's the makewhatis script itself which is doing it. See, unless
you specify the "-u" (update) flag, makewhatis truncates the
/var/cache/man/whatis file, because it's going to rebuild it.

Thing is, "makewhatis -w" restores man -k functionality, if I run it from
a shell prompt. Now, makewhatis is invoked from
/etc/cron.daily/makewhatis.cron and /etc/cron.weekly/makewhatis.cron. The
difference between those two is the daily one uses "-u -w", and the weekly
one uses "-w".

The only thing I can think of right now is that for some reason, the
manpath isn't being set, but only when makewhatis is run from cron.
However, the makewhatis shell script sets this by doing "man --path",
which, IIRC, uses /etc/man.config, so I can't imagine the returned string
being different interactively, as opposed to cron.

So, I've done a "chattr +i /var/cache/man/whatis". See if anything shows
up in a log file.

jed
-- 
We're frogs who are getting boiled in a pot full of single-character
morphemes, and we don't notice. - Larry Wall; Perl6, Apocalypse 5



More information about the clue-tech mailing list