aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service9
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend16
2 files changed, 16 insertions, 9 deletions
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
index 00bbf8d27..a13e2e635 100644
--- a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
+++ b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
@@ -2,9 +2,10 @@
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
+Type=dbus
+BusName=org.lightmediascanner
+ExecStart=/usr/bin/lightmediascannerd --startup-scan --directory=/usr/share/media
[Install]
-WantedBy=multi-user.target
+WantedBy=default.target
+Alias=dbus-org.lightmediascanner.service
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
index d2b790e81..f9c269d2e 100644
--- a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
+++ b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
@@ -7,13 +7,19 @@ 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
+ install -p -D ${WORKDIR}/lightmediascanner.service ${D}${systemd_user_unitdir}/lightmediascanner.service
+
+ # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
+ # because it does not support systemd's user mode.
+ mkdir -p ${D}/etc/systemd/user/default.target.wants/
+ ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/dbus-org.lightmediascanner.service
+ ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/default.target.wants/lightmediascanner.service
fi
}
+
+FILES_${PN} += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/lightmediascanner.service', '', d)} \
+ "