lightmediascanner: add systemd service 79/4279/2
authorLeon Anavi <leon.anavi@konsulko.com>
Thu, 5 Nov 2015 13:15:46 +0000 (15:15 +0200)
committerGerrit Code Review <gerrit@172.30.200.200>
Sat, 7 Nov 2015 00:01:57 +0000 (00:01 +0000)
Change-Id: I868d15c4d17c30c2807ce5f3d85adc1fefc6f90e
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service [new file with mode: 0644]
meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend

diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
new file mode 100644 (file)
index 0000000..00bbf8d
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lightmediascanner (LMS)
+
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
+User=root
+ExecStart=/usr/bin/dbus-launch --auto-syntax /usr/bin/lightmediascannerd --startup-scan --directory=/usr/share/media
+
+[Install]
+WantedBy=multi-user.target
index 7e63811..d2b790e 100644 (file)
@@ -1,2 +1,19 @@
 # Disable everything but the roygalty-free formats
 PACKAGECONFIG = "ogg flac wave m3u pls jpeg png"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://lightmediascanner.service"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = ""
+SYSTEMD_SERVICE_${PN} += "lightmediascanner.service"
+
+do_install_append() {
+       # Install LMS systemd service
+       if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+              install -p -D ${WORKDIR}/lightmediascanner.service ${D}${systemd_unitdir}/system/lightmediascanner.service
+       fi
+}