aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>2015-12-09 13:34:28 +0900
committerGerrit Code Review <gerrit@172.30.200.200>2015-12-11 12:13:50 +0000
commita0d9623fa7abc02e1856d089238a957dc27eab3c (patch)
tree6154f03da8cd63fb57cc10ef1c2cd15a74e7e08f
parente53d414809ffc519244640d31498056fff16c468 (diff)
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 <tanikawa.tadao@jp.panasonic.com>
-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)} \
+ "