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
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Andreas Radke (AndyRTR)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

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
Comment by Dave Reisner (falconindy) - Friday, 26 August 2016, 12:07 GMT
Two questions/suggestions about the proposed code:

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.
Comment by John (graysky) - Friday, 26 August 2016, 12:12 GMT
I was unaware of the --no-block switch you referenced. The goal is just to decouple the pacman hook (currently in use) to the time it takes the database to build. If your proposed change does that without the path unit, even better.
Comment by Jan Alexander Steffens (heftig) - Friday, 26 August 2016, 13:46 GMT
I'd rather return to just the timer.
Comment by Asbjørn Apeland (aude) - Tuesday, 20 September 2016, 02:30 GMT
  • Field changed: Percent Complete (100% → 0%)
The revert to a timer is really saving time.

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
Comment by Andreas Radke (AndyRTR) - Friday, 16 December 2016, 07:03 GMT
Jan, can we close this as "won't implement"?

I'd vote for not delaying the update process. We had this enabled for a short time and received lots of complains.

Loading...