Have you tried just connecting like I said before? systemd's D-Bus activation will make sure whichever polkit service is started once you try to connect to it. This is really the way you should handle it.

That being said, for future reference, to start a potentially nonexistent service first, you can try:

After=polkitd polkit


On June 30, 2018 3:11:10 AM Federico Di Pierro <[email protected]> wrote:

Hi Ryan,
thanks for your answer!

The issue is that some old distributions (ubuntu 16.04) had
polkitd.service, while new ones have polkit.service.
How can I specify a "Requires=" on both? Obviously one of them will fail
depending on system, thus my own service will fail too.

Thank you very much,
Federico


Il giorno sab 30 giu 2018 alle ore 00:10 Ryan Gonzalez <[email protected]>
ha scritto:

systemd can depend on services, not bus names. In your example, you'd want:

Wants=polkit

However, in most cases, you don't actually want to do this; if the service
(in this case, polkit) tells systemd what bus name it is going to ask for,
systemd will automatically wait when your service asks for it.

For instance, the moment your service tries to connect to
org.freedesktop.PolicyKit1, systemd will wait for polkit to start before
letting your service continue.

On June 29, 2018 4:44:27 PM Federico Di Pierro <[email protected]> wrote:

Hi everyone!

I was wondering whether there was a way for a systemd service to wait for
a bus name to appear before starting a service.
Something like:

Requires=org.freedesktop.PolicyKit1

I could not find much googling around.
Is this possible?
Thanks everyone!
Federico
_______________________________________________
systemd-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


_______________________________________________
systemd-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to