FS#50523 - [man-db] add systemd control over database rebuilds
Attached to Project:
Arch Linux
Opened by John (graysky) - Friday, 26 August 2016, 11:14 GMT
Last edited by Jan Alexander Steffens (heftig) - Friday, 16 December 2016, 07:06 GMT
Opened by John (graysky) - Friday, 26 August 2016, 11:14 GMT
Last edited by Jan Alexander Steffens (heftig) - Friday, 16 December 2016, 07:06 GMT
|
Details
I wrote an AUR package (mandb-ondemand) that makes updates
to the manpage index database much faster via a hook and
systemd service. Please consider this for our package.
Background: With the deployment of pacman hooks, maintenance of the manpage index database (/var/cache/man/index.db) has been integrated into pacman operations. Anytime a package writes or removes files to /usr/share/man, a hook triggers the rebuild of the index database which can be slow -- really slow. This is particularly noticeable on low powered PCs. The delay can be annoying as the terminal (more likely the ssh window) remains locked while the rebuild is in progress. mandb-ondemand flags the index database for a rebuild via a pacman hook that triggers a systemd unit to do the dirty work while pacman happily finishes thus leaving the shell free of the dreaded pause. Link to my upstream code: https://github.com/graysky2/mandb-ondemand Link to AUR package: https://aur.archlinux.org/packages/mandb-ondemand |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Friday, 16 December 2016, 07:06 GMT
Reason for closing: Won't implement
Friday, 16 December 2016, 07:06 GMT
Reason for closing: Won't implement
1) Why does the hook invoke the unit indirectly? Why not just `systemctl --no-block start mandb-update.service`? This makes the path unit unnecessary.
2) Why Type=oneshot? This will be a blocking transaction, whereas Type=simple would be sufficient and would not be blocking (as it has no readiness protocol).
Actually, I think it might be enough to change Arch's existing unit to Type=simple and this would all be largely unnecessary. The only caveat is that making the unit Type=simple disallows any subsequent ordering on the man DB being consistent. I think that's fine, as we've all survived with an inconsistent man DB for years.
It is possible to keep instant mandb update functionality and also make it a lot quicker. This can be done by passing only the changed files to `mandb`, similar to what is done in texinfo-{install,remove}.hook.
Here is an example: https://gist.github.com/aude/95b6402a01168734c681a1b4105c4e33
Can't quite decide on whether an always up-to-date mandb is worth the extra seconds of waiting after package management. RFC
I'd vote for not delaying the update process. We had this enabled for a short time and received lots of complains.