From a0d9623fa7abc02e1856d089238a957dc27eab3c Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Wed, 9 Dec 2015 13:34:28 +0900 Subject: Lightmediascanner becomes systemd user service Now lightmediascanner becomes systemd user service because it needs D-Bus session bus provided by D-Bus Daemon which is managed by systemd (as user service). Change-Id: I38aa8a60394dbf078b3dd3a42e60514816f96969 Signed-off-by: Tadao Tanikawa --- .../lightmediascanner/files/lightmediascanner.service | 9 +++++---- .../lightmediascanner/lightmediascanner_%.bbappend | 16 +++++++++++----- 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)} \ + " -- cgit 1.2.3-korg