Dear Maintainer, When installing plocate in a container, the plocate database is not generated. In Ubuntu we have been carrying the attached patch to create the plocate database in postinst since several years.
Hi, Thanks for the patch. However, this means installing plocate can make apt block further installation for unbounded amounts of time, even days on certain systems, and I doubt that is acceptable. /* Steinar */
I searched the bug reports and found https://bugs.launchpad.net/ubuntu/+source/plocate/+bug/1968388 So blocking for the update is not a good idea. But how can we solve the initial problem (installation in containers)? How about detecting if running in a container and only then update the db in postinst? containers are normally smaller than full desktop installations.
Can you elaborate what the problem is? Why does running background jobs not work correctly in the container system you are using? /* Steinar */
Some containers (e.g. schroot) do not have an init system running. So the systemd service is never started.
This sounds like something that is outside what each individual package should be dealing with? How do they deal with other packages that want to run timers? /* Steinar */
Also: How would you ever update the database if there are changes, if you care about plocate inside the container -- why is it acceptable to run updatedb once on postinst, and then never again? There's something about the use case here that eludes me. /* Steinar */
Timers are not run. Some other package update their DB in postinst or work without a db, but plocate complains: $ schroot -c unstable -u root $ apt install -y plocate $ plocate man /var/lib/plocate/plocate.db: No such file or directory
the initial use case was. For me: I have a schroot wrapper where I can specify what I want to have installed. I often use this as throw-away environment. So a one-time setup is good enough for me.
But this depends on when plocate was unpacked and configured relative to other packages? Depending on completely uncontrollable factors, you could have basically zero packages in your database, which then is never updated? Shouldn't you just run updatedb explicitly after apt in your setup script, in such a case? /* Steinar */
That's a good point. So we would need an apt hook (that is run at the end) instead of a postinst. That would be an alternative.