aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus.service10
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus.socket9
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus_env.conf5
-rw-r--r--meta-agl/recipes-core/dbus/dbus_%.bbappend26
4 files changed, 50 insertions, 0 deletions
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus.service b/meta-agl/recipes-core/dbus/dbus/dbus.service
new file mode 100644
index 000000000..dee6ad741
--- /dev/null
+++ b/meta-agl/recipes-core/dbus/dbus/dbus.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=D-Bus User Message Bus
+Documentation=man:dbus-daemon(1)
+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
+Restart=always
+RestartSec=1
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus.socket b/meta-agl/recipes-core/dbus/dbus/dbus.socket
new file mode 100644
index 000000000..af76b2f12
--- /dev/null
+++ b/meta-agl/recipes-core/dbus/dbus/dbus.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=D-Bus User Message Bus Socket
+Before=sockets.target
+
+[Socket]
+ListenStream=%t/bus
+
+[Install]
+WantedBy=default.target
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus_env.conf b/meta-agl/recipes-core/dbus/dbus/dbus_env.conf
new file mode 100644
index 000000000..f8f02669b
--- /dev/null
+++ b/meta-agl/recipes-core/dbus/dbus/dbus_env.conf
@@ -0,0 +1,5 @@
+[Unit]
+Wants=dbus.service
+
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus
diff --git a/meta-agl/recipes-core/dbus/dbus_%.bbappend b/meta-agl/recipes-core/dbus/dbus_%.bbappend
new file mode 100644
index 000000000..348be60c1
--- /dev/null
+++ b/meta-agl/recipes-core/dbus/dbus_%.bbappend
@@ -0,0 +1,26 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+
+SRC_URI_append = "file://dbus.service \
+ file://dbus.socket \
+ file://dbus_env.conf \
+ "
+
+inherit systemd
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -p -D ${WORKDIR}/dbus.service ${D}${systemd_user_unitdir}/dbus.service
+ install -p -D ${WORKDIR}/dbus.socket ${D}${systemd_user_unitdir}/dbus.socket
+ install -p -D ${WORKDIR}/dbus_env.conf ${D}${systemd_system_unitdir}/user@.service.d/dbus_env.conf
+
+ # 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}/dbus.socket ${D}/etc/systemd/user/default.target.wants/dbus.socket
+ fi
+}
+
+FILES_${PN} += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/dbus.*', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/user@.service.d/dbus_env.conf', '', d)} \
+ "