Draft: main/postmarketos-ui-*: use systemd presets to autostart services OOTB
This replaces explicit calls to systemctl
for autostarting services OOTB with a neat feature in systemd: service presets.
Thanks @calebccff for "discovering" this systemd feature!
TODO:
-
systemd can apply presets on first boot (see man systemd.preset), we should do this -
By removing the post-install/post-upgrade
scripts, we can no longer cover situations where the "default service preset policy" first set during the first boot changes in an upgrade.- For example, if pmos-ui-gnome's preset file has
enable foo
and an upgrade changes that todisable foo
, or if some new service is added on upgrade, then this preset config will not be applied to an existing installation unless the user runssystemctl preset-all
. They may not want to run that, since it would then roll back any service enabled changes they might have made (e.g.systemctl disable foo
might be undone by re-applying presets - Fedora ships a default policy (based on UI, etc) , but how do they handle changes to this policy on existing installs? Do they expect users to run
systemctl preset-all
manually or do they automate is somehow? If you only runsystemctl preset foo
whenfoo
is installed to work around this, I think this means a change to the preset policy would still not be applied sincefoo
might be installed but maybe now the policy says is should bedisabled
or something?
- For example, if pmos-ui-gnome's preset file has
Also see
Fedora has two wiki pages where they explain a little about how they use presets:
Edited by Administrator