[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why do we have a default activated man-db.timer?



Hi Étienne!

Thanks for your comprehensive explanation. I appreciate it very much.

Feb 12, 2019, 1:38 AM by etienne.mollier@mailoo.org:

> Tom Bachreier, on 2019-02-11:
>
>> BUT wait...
>>
>> I was wondering why do we have man-db.timer in the first place?
>>
>
> On my Sid machine, this file is known under the name of
> /usr/lib/systemd/system/man-db.service and has, among other
> things, these lines:
>
Just for the record:
On testing I found the file in /lib/systemd/system instead.

>
>  # Expunge old catman pages which have not been read in a week.
>  ExecStart=/usr/bin/find /var/cache/man -type f -name *.gz -atime +6 -delete
>  # Regenerate man database.
>  ExecStart=/usr/bin/mandb --quiet
>
> Seems there is not only a mandb re-indexing, but also some
> cleanup is done apparently, given the `find [...] -delete`.
>
[Re-indexing for man, whatis and apropos]

In my opinion still the perfect job for a postinstall-script. Manpages
doesn't change other than during install, update or remove of
packages.


>
> The other mechanism consists in caching the binary
> representation of compiled manual pages.  
>
[...]

> You can try for yourself how `man` handles the research inside
> your documentation by passing the debug option -d and browsing
> the output debug.out at your convenience:
>
>  $ man -d man 2> debug.out
>
> I discovered for instance that I never use this cache because I
> cap my terminal width to 65 characters using the variable
> MANWIDTH, and the debug output shown me:
>
>  Terminal width 65 not within cat page range [80, 80]
>
Same here. But I tried a 80 columns terminal, too and no cache files
were generated either. I don't care but it is strange. I do not even have
catx-directories - not in /usr/share/man/ or /var/cache/man/.

The debug shows in this case:
> found ultimate source file /usr/share/man/man1/man.1.gz
> converted /usr/share/man/man1/man.1.gz to /usr/share/man/cat1/man.1.gz
> is_changed: a=/usr/share/man/man1/man.1.gz, b=/usr/share/man/cat1/man.1.gz (-2)
> converted /var/cache/man/cat1/man.1.gz to /var/cache/man/cat1/man.1.gz
> will try cat file /var/cache/man/cat1/man.1.gz
[...]
> is_changed: a=/usr/share/man/man1/man.1.gz, b=/var/cache/man/cat1/man.1.gz (-2)
> cat dir /var/cache/man/cat1 does not exist

I would translate this to: It tried but failed to generate the cache file.

> Since lots of people do not use 80 char width terminals anymore,
> mostly because of "maximize window", I get this function is not
> of much use lately, at least not by using Debian default value.
> That thing can be configured in /etc/manpath.config if you are
> interested in such manipulations.
>
In /etc/manpath.config I found one can disable caching completely - nice.
> NOCACHE

>
> Well, I don't believe this catman mechanism is of much use
> today, most manual pages are rendered in the blink of an eye.
> Last time I had to /wait/ more than a seconds for a manual page
> to be formatted, that was on a Sun Fire V440.
>
I agree, for myself it is pretty useless. I never missed it.

>
> To summarize, the patched service does a clear the cache of
> unused raw man pages, which should not be referenced anymore by
> mandb.  Part of all this is more or less described in the manual
> pages man(1), most particularly in sections "OVERVIEW" and
> "DEFAULTS", which have a succinct descriptions of the various
> mechanisms involved.  See also catman(8) and mandb(8).
>
>
To summarize for myself. The timer/service doesn't do anything valuable
for me so I will disable it.

Étienne, thanks again for your time! It helped me to understand if the
timer is needed on my computers or not.

Tom


Reply to: