Waiting on a bus name to appear in systemd service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <nierro92 at gmail.com> 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 <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/1af9e4b6/attachment.html>


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux