sailfishos-patches / patchmanager

Patchmanager for SailfishOS
https://openrepos.net/content/patchmanager/patchmanager
Other
21 stars 22 forks source link

Ability to restart additional services, e.g., `profiled` #320

Open wetab73 opened 2 years ago

wetab73 commented 2 years ago

Patchmanager is currently able to restart only a very limited number of services. Please consider supporting more services that can be restarted, e.g. profiled (systemctl --user restart profiled).

I recently made a patch adding support for a custom profile (and a quick toggle button to easily switch it on/off) which creates an ini file in /etc/profiled/ containing definition of that custom profile for profiled. Unfortunately, it gets created by Patchmanager only after profiled has already been started, so it requires a profiled restart. Sadly, Patchmanager can't do it, so it'd have to be done manually after each reboot, which is a no-go.

So the suggestion is to enhance Patchmanager to support restarting more services (e.g. via adding corresponding categories).

nephros commented 2 years ago

31 requests something similar.

As mentioned there, even though the future-proof solution would be for patch authors to be able to specify services to be restarted, with PM running as root that is not a good solution.

Therefore I think this should be evaluated on a case-by-case (i.e. per service) basis (but can be implemented in a batch).

Also some user services may not be a good idea to restart (?).

profiled and ngfd are fine though I think.

Requires:

(I don't think the UI needs any changes but would have to check.)

nephros commented 2 years ago

Question: should we mash profiled and ngfd in a single category ("ui-feedback" or so)?

nephros commented 2 years ago

Unfortunately, it gets created by Patchmanager only after profiled has already been started, so it requires a profiled restart.

Just as a workaround, you could implement a service restart via dbus in a main.qml file shipped with the patch.

Example