Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Sandro Stiller <sandro.stiller@elfin.de>
To: openembedded-devel@lists.openembedded.org
Subject: systemd service not enabled when adding simple recipe to image
Date: Wed, 9 Mar 2016 13:21:09 +0100	[thread overview]
Message-ID: <56E01535.6030509@elfin.de> (raw)

Hello,
I have a problem enabling a simple systemd service:
If I install my package using the .ipk file, everything works fine
(systemd service ist enabled after install), but if I create an image
containing this package, the service is disabled.
It can be enabled by calling "systemctl enable <mytestscript.service>".
All files of the package are installed correctly (only the systemd
symlink is missing). I have other packages with working systemd, the
problem exists only in the simple case with a single shell script.

I use Angstrom v2015.06 / Yocto 1.8

Can anybody tell me what I'm doing wrong?

Thank you very much,

Sandro


My files:
###################### mytestscript.bb ########################
SUMMARY = "systemd test script"
DESCRIPTION = "This script is a quick demo for a not initialized systemd 
service."
SECTION = "console/network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = 
"file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

inherit systemd

SRC_URI = "file://mytestscript.service \
            file://mytestscript.sh \
           "

do_compile() {
}

do_install () {
   install -d ${D}${bindir}
   install -m 0755 ${WORKDIR}/mytestscript.sh ${D}${bindir}
   install -d ${D}${systemd_unitdir}/system
   install -m 0644 ${WORKDIR}/mytestscript.service 
${D}${systemd_unitdir}/system
   sed -i -e 's,@BINDIR@,${bindir},g' \
		${D}${systemd_unitdir}/system/mytestscript.service
}

NATIVE_SYSTEMD_SUPPORT = "1"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "mytestscript.service"
SYSTEMD_AUTO_ENABLE = "enable"

FILES_${PN} += "${systemd_unitdir}/system/mytestscript.service"

###################### files/mytestscript.sh #########################
#!/bin/sh
echo "Hello from testscript"

###################### files/mytestscript.service ######################
[Unit]
Description=A test script
After=local-fs.target

[Service]
Type=oneshot
ExecStart=@BINDIR@/mytestscript.sh

[Install]
WantedBy=multi-user.target


             reply	other threads:[~2016-03-09 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 12:21 Sandro Stiller [this message]
2016-03-23 14:22 ` systemd service not enabled when adding simple recipe to image Sandro Stiller
2016-03-24  4:25   ` Khem Raj

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=56E01535.6030509@elfin.de \
    --to=sandro.stiller@elfin.de \
    --cc=openembedded-devel@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox