aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Sarbu <florin.sarbu@windriver.com>2014-10-15 17:47:23 +0300
committerHolger Behrens <holger.behrens@windriver.com>2014-10-17 17:29:15 +0200
commite5ac7ca4ae3d5c2dce0fa9bfd28117709726fe7c (patch)
tree22dbfc2cadee26ccb4015bab451a6eb374b6a333
parentf8578f281dd7dad35fa1facedb5c48872d535fd8 (diff)
downloadmeta-ivi-e5ac7ca4ae3d5c2dce0fa9bfd28117709726fe7c.tar.gz
meta-ivi-e5ac7ca4ae3d5c2dce0fa9bfd28117709726fe7c.tar.bz2
meta-ivi-e5ac7ca4ae3d5c2dce0fa9bfd28117709726fe7c.zip
dbus: Enable dbus session
Certain applications need a session dbus bus. We add the dbus .service and .socket and also add a drop-in dbus.conf file which sets the DBUS_SESSION_BUS_ADDRESS for user systemd services. Signed-off-by: Florin Sarbu <florin.sarbu@windriver.com> Signed-off-by: Holger Behrens <holger.behrens@windriver.com>
-rw-r--r--meta-ivi-demo/recipes-core/dbus/dbus/dbus.conf2
-rw-r--r--meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.service7
-rw-r--r--meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.socket9
-rw-r--r--meta-ivi-demo/recipes-core/dbus/dbus_%.bbappend16
4 files changed, 34 insertions, 0 deletions
diff --git a/meta-ivi-demo/recipes-core/dbus/dbus/dbus.conf b/meta-ivi-demo/recipes-core/dbus/dbus/dbus.conf
new file mode 100644
index 0000000..8ca4aed
--- /dev/null
+++ b/meta-ivi-demo/recipes-core/dbus/dbus/dbus.conf
@@ -0,0 +1,2 @@
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
diff --git a/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.service b/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.service
new file mode 100644
index 0000000..1851818
--- /dev/null
+++ b/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=D-Bus Message Bus
+Requires=dbus.socket
+
+[Service]
+ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
+ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
diff --git a/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.socket b/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.socket
new file mode 100644
index 0000000..3eaa0c6
--- /dev/null
+++ b/meta-ivi-demo/recipes-core/dbus/dbus/dbus_user.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=D-Bus Message Bus Socket
+Before=sockets.target
+
+[Socket]
+ListenStream=%t/dbus/user_bus_socket
+
+[Install]
+WantedBy=default.target
diff --git a/meta-ivi-demo/recipes-core/dbus/dbus_%.bbappend b/meta-ivi-demo/recipes-core/dbus/dbus_%.bbappend
new file mode 100644
index 0000000..cbff871
--- /dev/null
+++ b/meta-ivi-demo/recipes-core/dbus/dbus_%.bbappend
@@ -0,0 +1,16 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+
+SRC_URI_append = "file://dbus_user.service \
+ file://dbus_user.socket \
+ file://dbus.conf \
+ "
+
+do_install_append() {
+ mkdir -p ${D}/etc/systemd/user
+ cp ${WORKDIR}/dbus_user.service ${D}/etc/systemd/user/dbus.service
+ cp ${WORKDIR}/dbus_user.socket ${D}/etc/systemd/user/dbus.socket
+ mkdir -p ${D}/etc/systemd/user/default.target.wants
+ ln -sf /etc/systemd/user/dbus.socket ${D}/etc/systemd/user/default.target.wants/dbus.socket
+ mkdir -p ${D}/etc/systemd/system/user\@.service.d
+ cp ${WORKDIR}/dbus.conf ${D}/etc/systemd/system/user\@.service.d
+}