From: "piotr.lewicki" <piotr.lewicki@elfin.de>
To: "Dey, Megha" <megha.dey@intel.com>,
"yocto@yoctoproject.org" <yocto@yoctoproject.org>,
"poky@yoctoproject.org" <poky@yoctoproject.org>
Subject: Re: Script being installed under /etc/init.d instead of /usr/lib/systemd folder
Date: Tue, 14 Jun 2016 17:32:53 +0200 [thread overview]
Message-ID: <576023A5.90006@elfin.de> (raw)
In-Reply-To: <C440BA31B54DCD4AAC682D2365C8FEE703C9DE63@ORSMSX113.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]
Take a look at example from my some-recipe.bb
:
inherit systemd
SYSTEMD_SERVICE_${PN} = "some-recipe.service"
do_install_append () {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${S}/configs/some-recipe.service
${D}${systemd_unitdir}/system
}
First in your recipe inherit from "systemd".
Then install your systemd service file in
"${D}${systemd_unitdir}/system" (there is also a variable for this
directory, I think it's ${systemd_system_unitdir} or something similar).
Remember to create a directory before placing a file there.
In the last step use "SYSTEMD_SERVICE_${PN}" where you specify systemd
services that should be run.
I hope that helps..
Best regards,
Piotr Lewicki
On 09.06.2016 03:11, Dey, Megha wrote:
>
> Hi,
>
> I am trying to use the systemd init system from the existing system. I
> have added the following to my conf file:
>
> DISTRO_FEATURES_append = " systemd"
>
> VIRTUAL-RUNTIME_init_manager = "systemd"
>
> VIRTUAL-RUNTIME_initscripts = ""
>
> DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
>
> I have also added the ‘systemd’ binary to the INSTALL_APPEND.
>
> When I boot the resulting image, I do see systemd up and running and I
> am able to start and stop services.
>
> However, I do have a script recipe which is currently placed as a
> bbappend to initscripts
> (meta/recipes-core/initscripts/initscript_..bb) in my custom meta layer.
>
> This script even after shifting to systemd, is being placed in the
> /etc/init.d/ folder, and hence doesn’t run on boot. I want this to be
> placed in the /usr/lib/system.d/ folder instead. How would I be able
> to do this?
>
> Is it because this script is an append to initscripts, it by default
> gets installed under /etc/init.d? If so, where should I place the recipe?
>
> Thanks,
>
> Megha
>
>
>
[-- Attachment #2: Type: text/html, Size: 4855 bytes --]
next prev parent reply other threads:[~2016-06-14 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 1:11 Script being installed under /etc/init.d instead of /usr/lib/systemd folder Dey, Megha
2016-06-14 15:32 ` piotr.lewicki [this message]
2016-06-14 16:41 ` [yocto] " Burton, Ross
2016-06-14 16:41 ` Burton, Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=576023A5.90006@elfin.de \
--to=piotr.lewicki@elfin.de \
--cc=megha.dey@intel.com \
--cc=poky@yoctoproject.org \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.