All of lore.kernel.org
 help / color / mirror / Atom feed
* Make the service the last run in boot
@ 2019-08-01  7:37 JH
  2019-08-01  9:17 ` ChenQi
  0 siblings, 1 reply; 6+ messages in thread
From: JH @ 2019-08-01  7:37 UTC (permalink / raw)
  To: Yocto discussion list

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.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Make the service the last run in boot
  2019-08-01  7:37 Make the service the last run in boot JH
@ 2019-08-01  9:17 ` ChenQi
  2019-08-01 11:08   ` JH
  0 siblings, 1 reply; 6+ messages in thread
From: ChenQi @ 2019-08-01  9:17 UTC (permalink / raw)
  To: yocto

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Make the service the last run in boot
  2019-08-01  9:17 ` ChenQi
@ 2019-08-01 11:08   ` JH
  2019-08-01 16:25     ` Rudolf J Streif
  2019-08-02  1:37     ` ChenQi
  0 siblings, 2 replies; 6+ messages in thread
From: JH @ 2019-08-01 11:08 UTC (permalink / raw)
  To: ChenQi; +Cc: yocto

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@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Make the service the last run in boot
  2019-08-01 11:08   ` JH
@ 2019-08-01 16:25     ` Rudolf J Streif
  2019-08-02 10:26       ` JH
  2019-08-02  1:37     ` ChenQi
  1 sibling, 1 reply; 6+ messages in thread
From: Rudolf J Streif @ 2019-08-01 16:25 UTC (permalink / raw)
  To: JH, ChenQi; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 1851 bytes --]

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@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@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
-- 
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3396 x700



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Make the service the last run in boot
  2019-08-01 11:08   ` JH
  2019-08-01 16:25     ` Rudolf J Streif
@ 2019-08-02  1:37     ` ChenQi
  1 sibling, 0 replies; 6+ messages in thread
From: ChenQi @ 2019-08-02  1:37 UTC (permalink / raw)
  To: JH; +Cc: yocto

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@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@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Make the service the last run in boot
  2019-08-01 16:25     ` Rudolf J Streif
@ 2019-08-02 10:26       ` JH
  0 siblings, 0 replies; 6+ messages in thread
From: JH @ 2019-08-02 10:26 UTC (permalink / raw)
  To: Rudolf J Streif; +Cc: yocto

Terrific, that works well, thanks Rudolf and ChenQi.

On 8/2/19, Rudolf J Streif <rudolf.streif@ibeeto.com> wrote:
> 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@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@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/yocto
>>>
> --
> -----
> Rudolf J Streif
> CEO/CTO ibeeto
> +1.855.442.3396 x700
>
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-02 10:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  7:37 Make the service the last run in boot JH
2019-08-01  9:17 ` ChenQi
2019-08-01 11:08   ` JH
2019-08-01 16:25     ` Rudolf J Streif
2019-08-02 10:26       ` JH
2019-08-02  1:37     ` ChenQi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.