Comment 15 for bug 1001189

Revision history for this message
Nathan Stratton Treadway (nathanst) wrote : Re: [Bug 1001189] Re: 'man' command fails with lseek error

On Sun, May 20, 2012 at 18:27:11 -0000, Paul Crawford wrote:
> The $PATH variables are different, with the 12.04 (32-bit) system having
> /packages/local/bin included in the list. If I remove that from the
> 12.04 system it then avoids the /packages/local/share/man/index.db file
> and it works.

Cool. (See below.)

> However, if I add /packages/local/bin to the 10.04 system (64-bit, in
> case it matters) it takes noticeably longer to present the page, and it
> reads the /packages/local/share/man/index.db file (according to strace),
> but it still works!

Out of curiousity: does the strace show that after opening at the
/packages/.../index.db file man proceeds to open the
/var/cache/.../index.db file before showing you the man page?

(Also, does the strace show the same "lseek" after the
/packages/.../index.db open() call as the one you reported earlier on
Precise?)

Finally, are you able to open any of the man pages found under
/packages/.../man/ ? (Just wondering if that index.db file is actually
usable by e.g. the Lucid machine, or if it also treats it as corrupt but
just fails more gracefully somehow.)

Anyway, here's a quote from the
/usr/share/doc/man-db/man-db-manual.txt.gz file that describes the $PATH-
to-manpath mapping (and I think explains the behavior that you found):

  Assuming that a $PATH exists, each path element it contains is
  scanned for in the config file. If found, the corresponding manpath
  element is appended to the internal manpath. However, if the element
  is not mentioned in the config file, a man directory relative to it
  will be sought. The subdirectories ../man, man, ../share/man, or
  share/man relative to the path component are appended to the internal
  manpath if they exist.

Running the "manpath" command (or "man --path" in the Precise version of
man-db) will print out the auto-generated manpath search list.

      Nathan