#641932 man-db: Do not throw all messages from error output away

Package:
man-db
Source:
man-db
Description:
tools for reading manual pages
Submitter:
Bjarni Ingi Gislason
Date:
2014-09-16 22:21:04 UTC
Severity:
wishlist
#641932#5
Date:
2011-09-17 19:34:46 UTC
From:
To:
  Warnings and error messages are important to show possible
defects in a manual.  Redirecting them to a file (e.g.
"/var/log/mandb.err") is better than discarding them.

  I changed the file "man-db" in both "/etc/cron.daily" and
"/etc/cron.weekly" to catch errors in man pages.

  The last part of my file in "cron.daily" is

#--Start of example----#
# regenerate man database
if [ -x /usr/bin/mandb ]; then
    temp_err=$(mktemp --tmpdir cron.daily.man-db.$$.XXXX)
    err_file='/var/log/mandb.err'
    # --pidfile /dev/null so it always starts; mandb isn't really a daemon,
    # but we want to start it like one.
    start-stop-daemon --start --pidfile /dev/null \
		      --startas /usr/bin/mandb --oknodo --chuid man \
		      $iosched_idle \
		      -- --no-purge  2>&1 | \
       tr '\015' '\012' | \
	 grep -F -e 'mandb' -e 'warn' > \
         $temp_err || :

    if test -s $temp_err
    then
       { date ; echo '####' ; cat $temp_err ;\
       echo '#####' ; } >> $err_file
    fi

    rm $temp_err
fi

exit 0
#--End of example----#

  For the file in "/etc/cron.weekly" the name "cron.daily" is
changed to "cron.weekly".


  Example of the output to file "$err_file" is:

Sat Aug 27 19:05:33 GMT 2011
####
/usr/bin/mandb: warning: /usr/share/man/man1/dotlockfile.1.gz: whatis parse for dotlockfile(1) failed
/usr/bin/mandb: warning: /usr/share/man/man1/vlna.1.gz: whatis parse for vlna(1) failed
#####

  A rule for logrotate could be put into "/etc/logrotate.conf",
e.g.

/var/log/mandb.err {
    missingok
    size=10k
}

#641932#12
Date:
2014-09-16 22:17:25 UTC
From:
To:
Control: tag -1 wontfix

I'm not convinced that it makes sense to catch them this way.  We
already have a better way to collect defects via Lintian, notably these
two tags:

https://lintian.debian.org/tags/manpage-has-bad-whatis-entry.html
https://lintian.debian.org/tags/manpage-has-errors-from-man.html

It would be possible to log all of these on every Debian system, yes.
However, it would be a tremendously inefficient way to record these
defects compared to the existing Lintian reports which are much more
convenient for maintainers.  Logging them locally would simply encourage
people to duplicate lots of effort reporting them manually as bugs,
which doesn't seem like a good use of time unless they're going to go to
the extra effort to figure out patches too; and history indicates that
some sizeable fraction of those reports will be misdirected to man-db
and I'll have to spend time reassigning them to the right places.
Furthermore, manual page errors are usually considered too minor to fix
in stable releases, so users of stable will have a pile of error reports
that are unlikely to be fixed at least until they upgrade to the next
stable release.

I can see some small value in logging these errors for the cases of
packages which are not in Debian and thus not covered by Lintian runs,
certainly.  However, there are other ways to get hold of the same error
messages (e.g. lexgrog), and in any case I think the benefits of this
logging would be too small to outweigh the costs.

Sorry,