[systemd-devel] Waiting on a bus name to appear in systemd service

Federico Di Pierro nierro92 at gmail.com
Sat Jun 30 08:11:32 UTC 2018


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 <rymg19 at gmail.com>
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 <nierro92 at gmail.com> 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
>> systemd-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180630/c22096d4/attachment.html>


More information about the systemd-devel mailing list