For the new changelog filtering logic in apt-listchanges, I'd like to
run a background job after the package finishes installing to populate
the seen database with the most recent current changelog and NEWS
entries for all installed packages, so they don't have to be populated
at package upgrade time. This will significantly improve the user
experience in terms of reducing the time it takes to display changes
during upgrades. It should only need to be run once on any system.
I don't want this to run synchronously during installation because it'll
take a long time and there's no need.
The simplest solution is to launch the job in postinst and daemonize it
so it keeps running even after the upgrade finishes. However, that's not
correct since if the user reboots after the upgrade it'll kill the job.
The other idea I had was to install and enable a systemd timer that
attempts to run the job hourly after installation, and then have the job
disable the timer when it completes successfully.
Is there a better / different / "Debian standard" way to accomplish this?
Thanks,
Jonathan Kamens
P.S. Just for the record, the background job will checkpoint its
progress periodically so it doesn't have to redo all the work if it gets
killed in the middle, and it'll checkpoint and pause whenever the load
average goes above 1 to minimize its performance impact on the system.