[yocto] Make the service the last run in boot

ChenQi Qi.Chen at windriver.com
Thu Aug 1 18:37:18 PDT 2019


On 08/01/2019 07:08 PM, JH wrote:
> The application requires network connection to communicate services
> via Internet, it could only work if the network connection is ready,
> so I really want to know which system servuce run at last I could put
> it in the After statement.

If you app only requires network, you just need After=network.target. 
Did you try that out?

> On 8/1/19, ChenQi <Qi.Chen at windriver.com> wrote:
>> On 08/01/2019 03:37 PM, JH wrote:
>>> Hi,
>>>
>>> How can I find the systemd last run service I can put it in my network
>>> application After=<last run tartget or service>?
>>>
>>> I need my network application service to be run at last in boot, I
>>> made After=connman and Requires=connman.service that did not work,
>>> always failed in boot, I have to manually restart the network
>>> application service which won't work in field operation.
>> I'd suggest you find out what you network service actually require.
>>
>>> Searched from Internet, there is a blog Systemd: Run it last to create
>>> a custom.target After=multi-user.target, and put my network
>>> application service WantedBy=custom.target, that works well, but it is
>>> a little bit cumbersome to configure customer.target in Yocto bb file,
>>> enabling the customer.target is called systemctl isolate
>>> custom.target, the /etc/systemd/system/default.target link needs be
>>> changed to from multi-user.target to custom.target. I am not sure how
>>> it could be done in do_install, appreciate your tips.
>>>
>>> Thank you.
>>>
>>> Kind regards,
>>>
>>> - JH
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>



More information about the yocto mailing list