All of lore.kernel.org
 help / color / mirror / Atom feed
* systemd service not enabled when adding simple recipe to image
@ 2016-03-09 12:21 Sandro Stiller
  2016-03-23 14:22 ` Sandro Stiller
  0 siblings, 1 reply; 3+ messages in thread
From: Sandro Stiller @ 2016-03-09 12:21 UTC (permalink / raw)
  To: openembedded-devel

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


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

end of thread, other threads:[~2016-03-24  4:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 12:21 systemd service not enabled when adding simple recipe to image Sandro Stiller
2016-03-23 14:22 ` Sandro Stiller
2016-03-24  4:25   ` Khem Raj

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.