[yocto] Make the service the last run in boot

Rudolf J Streif rudolf.streif at ibeeto.com
Thu Aug 1 09:25:13 PDT 2019


Adding

After=multi-user.target

to the [Unit] section in your systemd service file should do what you want.

:rjs

On 8/1/19 4:08 AM, 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.
>
> 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
>>
-- 
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3396 x700


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190801/ac56a089/attachment.pgp>


More information about the yocto mailing list