Patchwork [1/2] oprofileui-server: Add systemd support

login
register
mail settings
Submitter Shakeel, Muhammad
Date Sept. 12, 2013, 6:31 a.m.
Message ID <1378967479-8725-1-git-send-email-muhammad_shakeel@mentor.com>
Download mbox | patch
Permalink /patch/57861/
State Accepted
Commit 27bb9d0a9025043250edd09a334e6657073f26a3
Headers show

Comments

Shakeel, Muhammad - Sept. 12, 2013, 6:31 a.m.
From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

-Remove dependency on meta-systemd

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 .../oprofileui-server/oprofileui-server.service    |    6 ++++++
 .../oprofile/oprofileui-server_git.bb              |   13 +++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

Patch

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
index 0000000..1a2cbe6
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
@@ -0,0 +1,6 @@ 
+[Unit]
+Description=OProfileUI Server
+After=network.target
+
+[Service]
+ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server_git.bb b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
index 200bab3..70a1fbf 100644
--- a/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
+++ b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
@@ -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"