New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide systemd unit to refresh cache on updates #314
Comments
|
I thought of another potential use case for this - triggering cache rebuilds on input file updates. This would apply in the traditional stateful OS case. For instance, currently the apt hook directly runs In both cases you could have a systemd path unit that triggers the above mentioned service when changes to the system appstream input paths happen. My understanding is that it will look for |
|
Hi! So, in general, I think I would absolutely accept this change as a PR - it's a good addition, and something I had thought about before as well. Could make sense to put it behind a compile-time switch at least initially though. Does systemd immediately run the service once something in the respective watched directories changed? Or will it just run the service on a reboot then? In the former case, this could possibly replace the dpkg trigger mechanism (with some safeguards so we don't update the cache over and over again). |
|
Something like this may actually also help with issues like #365 (at least if used for Flatpak stuff) |
On stateless systems like ostree, the appstream cache needs to be rebuilt at runtime after system updates. The way we've typically handled these things at Endless is to add a systemd service that uses the
ConditionNeedsUpdateoption. That way it runs during boot after an update but not at other times. This would allow us to ship appstream data in the OS at/usr/share/app-info.You can see an example of this type of unit in systemd. For systems that make use of the
/{etc,var}/.updatedscheme, this rebuilds the linker cache after an update. On classic stateful systems that don't use that scheme, the unit never runs as it's expected other process take care of updating the linker cache. For example, dpkg or rpm post scripts.Anyways, I think the unit would essentially be this:
Does that seem like something that would be acceptable here? I can put together a PR if so.
The text was updated successfully, but these errors were encountered: