oprofileui-server: Add systemd support
authorMuhammad Shakeel <muhammad_shakeel@mentor.com>
Thu, 12 Sep 2013 06:31:18 +0000 (06:31 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 Sep 2013 07:29:41 +0000 (08:29 +0100)
-Remove dependency on meta-systemd

(From OE-Core rev: 177bf318bcd3dd2bfb3bec094b1f5ccac7bdd9ac)

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service [new file with mode: 0644]
meta/recipes-kernel/oprofile/oprofileui-server_git.bb

diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
new file mode 100644 (file)
index 0000000..1a2cbe6
--- /dev/null
@@ -0,0 +1,6 @@
+[Unit]
+Description=OProfileUI Server
+After=network.target
+
+[Service]
+ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
index 200bab3..70a1fbf 100644 (file)
@@ -6,7 +6,8 @@ PV = "0.0+git${SRCPV}"
 S = "${WORKDIR}/git"
 
 SRC_URI = "git://git.yoctoproject.org/oprofileui \
-           file://init"
+           file://init \
+           file://oprofileui-server.service "
 
 EXTRA_OECONF += "--disable-client --enable-server"
 
@@ -15,9 +16,17 @@ RDEPENDS_${PN} = "oprofile"
 do_install_append() {
        install -d ${D}${sysconfdir}/init.d
        install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/oprofileui-server
+
+       install -d ${D}${systemd_unitdir}/system
+       install -m 0644 ${WORKDIR}/oprofileui-server.service ${D}${systemd_unitdir}/system/
+       sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+               -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/oprofileui-server.service
 }
 
+inherit update-rc.d systemd
+
 INITSCRIPT_NAME = "oprofileui-server"
 INITSCRIPT_PARAMS = "start 999 5 2 . stop 20 0 1 6 ."
 
-inherit update-rc.d
+SYSTEMD_SERVICE_${PN} = "oprofileui-server.service"
+SYSTEMD_AUTO_ENABLE = "disable"