rygel: add systemd service 81/4281/2
authorLeon Anavi <leon.anavi@konsulko.com>
Thu, 5 Nov 2015 13:16:36 +0000 (15:16 +0200)
committerGerrit Code Review <gerrit@172.30.200.200>
Sat, 7 Nov 2015 00:01:57 +0000 (00:01 +0000)
Change-Id: I30193ff62fdea97c2cd100a031c60458879d11c8
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
meta-agl/recipes-connectivity/rygel/files/rygel.service [new file with mode: 0644]
meta-agl/recipes-connectivity/rygel/rygel_%.bbappend

diff --git a/meta-agl/recipes-connectivity/rygel/files/rygel.service b/meta-agl/recipes-connectivity/rygel/files/rygel.service
new file mode 100644 (file)
index 0000000..95c701d
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Rygel
+After=lightmediascanner.service
+Requires=lightmediascanner.service
+
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
+User=root
+ExecStartPre=/bin/sleep 3
+ExecStart=/usr/bin/dbus-launch --auto-syntax /usr/bin/rygel -c /etc/rygel.conf
+
+[Install]
+WantedBy=multi-user.target
index 9363c3c..7cfb9c0 100644 (file)
@@ -5,4 +5,18 @@ PACKAGECONFIG[lms] = "--enable-lms-plugin,--disable-lms-plugin,sqlite3"
 # LightMediaScanner plugin patches
 SRC_URI += "file://0001-Add-LightMediaScanner-plugin.patch \
             file://0002-lms-add-C-source-files.patch \
+            file://rygel.service \
             "
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = ""
+SYSTEMD_SERVICE_${PN} += "rygel.service"
+
+do_install_append() {
+       # Install rygel systemd service
+       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+              install -p -D ${WORKDIR}/rygel.service ${D}${systemd_unitdir}/system/rygel.service
+       fi
+}