summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Anavi <leon.anavi@konsulko.com>2015-11-05 15:15:46 +0200
committerGerrit Code Review <gerrit@172.30.200.200>2015-11-07 00:01:57 +0000
commit6e80fd4f6bdbd49a658ca07a15f0aabff9953dad (patch)
tree28dfa54a3b9542ea70811b3a3543943de815a3d3
parente873ca6bed7996d9ee7593651808b94fa8f68e0f (diff)
lightmediascanner: add systemd service
Change-Id: I868d15c4d17c30c2807ce5f3d85adc1fefc6f90e Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service10
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend17
2 files changed, 27 insertions, 0 deletions
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
new file mode 100644
index 000000000..00bbf8d27
--- /dev/null
+++ b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
@@ -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
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
index 7e6381113..d2b790e81 100644
--- a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
+++ b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
@@ -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
+}