All of lore.kernel.org
 help / color / mirror / Atom feed
* How to enabled systemd unit files automatically using recipe?
@ 2022-10-25  6:29 Sourabh Hegde
  2022-10-25  7:05 ` [yocto] " Sergei Nikulov
  0 siblings, 1 reply; 6+ messages in thread
From: Sourabh Hegde @ 2022-10-25  6:29 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

Hello,

This might not be directly related to Yocto.

I have a systemd .path unit file that restarts the system service if the file changes. But, the path ubit file needs to be enabled once to make this work. So, my question is when I flash new image on the device will the path unit file enabled automatically by systemctl? Or should I do this manually using "systemctl enable --now *.path" ? Is there any way to make this work using Yocto recipe?

The custome systemd service files are installed in dir "${D}${systemd_unitdir}/system/".

Thanks in advance

[-- Attachment #2: Type: text/html, Size: 599 bytes --]

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

* Re: [yocto] How to enabled systemd unit files automatically using recipe?
  2022-10-25  6:29 How to enabled systemd unit files automatically using recipe? Sourabh Hegde
@ 2022-10-25  7:05 ` Sergei Nikulov
  2022-10-25  7:31   ` Sourabh Hegde
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Nikulov @ 2022-10-25  7:05 UTC (permalink / raw)
  To: Sourabh Hegde; +Cc: yocto

On Tue, Oct 25, 2022 at 9:29 AM Sourabh Hegde <hrsourabh011@gmail.com> wrote:
>
> Hello,
>
> This might not be directly related to Yocto.
>
> I have a systemd .path unit file that restarts the system service if the file changes. But, the path ubit file needs to be enabled once to make this work. So, my question is when I flash new image on the device will the path unit file enabled automatically by systemctl? Or should I do this manually using "systemctl enable --now *.path" ? Is there any way to make this work using Yocto recipe?
>
> The custome systemd service files are installed in dir "${D}${systemd_unitdir}/system/".
>
> Thanks in advance
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#58406): https://lists.yoctoproject.org/g/yocto/message/58406
> Mute This Topic: https://lists.yoctoproject.org/mt/94553177/3617615
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [sergey.nikulov@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

You should add you file to your bb recipe SYSTEMD_SERVICE:${PN} = "file.path"

https://docs.yoctoproject.org/current/ref-manual/classes.html?highlight=systemd_service

-- 
Best Regards,
Sergei Nikulov


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

* Re: How to enabled systemd unit files automatically using recipe?
  2022-10-25  7:05 ` [yocto] " Sergei Nikulov
@ 2022-10-25  7:31   ` Sourabh Hegde
  2022-10-25  7:36     ` [yocto] " Sergei Nikulov
  0 siblings, 1 reply; 6+ messages in thread
From: Sourabh Hegde @ 2022-10-25  7:31 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

Hello Sergei,

Thanks for the update.

I have already added " SYSTEMD_SERVICE:${PN}" to my recipe. But, it is set to different file(.service file). Can I add multiple files to it?

[-- Attachment #2: Type: text/html, Size: 244 bytes --]

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

* Re: [yocto] How to enabled systemd unit files automatically using recipe?
  2022-10-25  7:31   ` Sourabh Hegde
@ 2022-10-25  7:36     ` Sergei Nikulov
  2022-10-25  7:39       ` Sourabh Hegde
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Nikulov @ 2022-10-25  7:36 UTC (permalink / raw)
  To: Sourabh Hegde; +Cc: yocto

Yes, sure.
Use space to separate multiple paths
For example:
SYSTEMD_SERVICE:${PN} = "one.service two.service one.path two.path"

On Tue, Oct 25, 2022 at 10:31 AM Sourabh Hegde <hrsourabh011@gmail.com> wrote:
>
> Hello Sergei,
>
> Thanks for the update.
>
> I have already added "SYSTEMD_SERVICE:${PN}" to my recipe. But, it is set to different file(.service file). Can I add multiple files to it?
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#58410): https://lists.yoctoproject.org/g/yocto/message/58410
> Mute This Topic: https://lists.yoctoproject.org/mt/94553177/3617615
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [sergey.nikulov@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


-- 
Best Regards,
Sergei Nikulov


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

* Re: How to enabled systemd unit files automatically using recipe?
  2022-10-25  7:36     ` [yocto] " Sergei Nikulov
@ 2022-10-25  7:39       ` Sourabh Hegde
  2022-11-30 12:20         ` Sourabh Hegde
  0 siblings, 1 reply; 6+ messages in thread
From: Sourabh Hegde @ 2022-10-25  7:39 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 20 bytes --]

Cool. Thanks again

[-- Attachment #2: Type: text/html, Size: 20 bytes --]

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

* Re: How to enabled systemd unit files automatically using recipe?
  2022-10-25  7:39       ` Sourabh Hegde
@ 2022-11-30 12:20         ` Sourabh Hegde
  0 siblings, 0 replies; 6+ messages in thread
From: Sourabh Hegde @ 2022-11-30 12:20 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

I have a question here:

If I something like below in my recipe

SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'one.service', '', d)}"

Then, can I add multiple files with:

SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'one.service one.path two.service two.path', '', d)}"

?

Is this valid? Or should I use only SYSTEMD_SERVICE:${PN} = "one.service two.service one.path two.path" ?

Thanks in advance

[-- Attachment #2: Type: text/html, Size: 583 bytes --]

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

end of thread, other threads:[~2022-11-30 12:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25  6:29 How to enabled systemd unit files automatically using recipe? Sourabh Hegde
2022-10-25  7:05 ` [yocto] " Sergei Nikulov
2022-10-25  7:31   ` Sourabh Hegde
2022-10-25  7:36     ` [yocto] " Sergei Nikulov
2022-10-25  7:39       ` Sourabh Hegde
2022-11-30 12:20         ` Sourabh Hegde

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.