ValShaped/rwfus

polkit.service needs to be restarted after installation

docwhat opened this issue · 6 comments

If you have anything that installs polkit actions in /usr/share/polkit-1/actions/ then polkit.service needs to be restarted to pick those changes up.

I haven't checked the boot order yet, but it may require a change to the systemctl files as well.

My use case was I tried to install 1Password and have it use system unlock (e.g., polkit) and it wouldn't see the action. Since I just learned about polkit today, this took a while to debug. ;-)

PS: I volunteer my dog, Rufus, as a mascot for this project if you'd like:

IMG_4704

EDIT: Having multiple units in Stop_Units, Mask_Units, Restart_Units is currently broken? Hmm.
Fixed on dev branch!
Great suggestion, and a cute dog too! In the mean time, you can add polkit.service to /etc/opt/rwfus.conf Service/Restart_Units:

--- snip ---
[Service]
# Units to [Stop|Mask|Restart] while Rwfus is running
Stop_Units         var-cache-pacman.mount
Mask_Units         pacman-cleanup.service
Restart_Units      usr-local.mount polkit.service

(I should note that this will stop polkit entirely before Rwfus starts, and start it when Rwfus finishes. This behavior might not be ideal in this specific case..)

You should only need to restart it after launching rwfus.

It doesn't hurt before or during the launch since it continues to see the original filesystem.

That's true; however, it reuses existing machinery. I'd be up for adding a new config entry for restartable/reloadable units, though

That's true; however, it reuses existing machinery. I'd be up for adding a new config entry for restartable/reloadable units, though

I'm not sure what you mean. Would you be willing to explain it to me?

Since Rwfus 0.4.0 (if I remember correctly), rwfusd has been able to stop and start other services when it starts/stops.

This was implemented, because SteamOS Offload uses systemd mount units to auto-mount certain things after /home/ is mounted.

If you mask a mounted filesystem with another mounted filesystem, and then try to unmount the first filesystem, systemd will mark the mount unit as failed and refuse to remount it. I worked around that by stopping the mount units while Rwfus is in the process of activating, and then restarting them when it finished activation.

In 0.4.1, Rwfus uses this same "machinery" (stopping polkit, activating itself, starting polkit) to handle reloading polkit, even though it would not fail, because I already had code to do that. I'd be open to add code to explicitly reload units, if that'd be a good feature, but it seems to work just fine as-is.