summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-agl/recipes-connectivity/rygel/files/rygel.service13
-rw-r--r--meta-agl/recipes-connectivity/rygel/rygel_%.bbappend14
2 files changed, 27 insertions, 0 deletions
diff --git a/meta-agl/recipes-connectivity/rygel/files/rygel.service b/meta-agl/recipes-connectivity/rygel/files/rygel.service
new file mode 100644
index 000000000..95c701d04
--- /dev/null
+++ b/meta-agl/recipes-connectivity/rygel/files/rygel.service
@@ -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
diff --git a/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend b/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend
index 9363c3cdc..7cfb9c063 100644
--- a/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend
+++ b/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend
@@ -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
+}