]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
user dbus.socket: Set DBUS_SESSION_BUS_ADDRESS
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Thu, 22 Oct 2015 17:50:29 +0000 (19:50 +0200)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 26 Oct 2015 11:59:36 +0000 (11:59 +0000)
As discussed in <https://github.com/systemd/systemd/issues/1600>.
See also <https://bugs.archlinux.org/task/46721>,
<https://bugzilla.gnome.org/show_bug.cgi?id=756420>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92612
[smcv: use AC_PATH_PROG to find systemctl; ignore systemctl failure]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
[smcv: add links to earlier bug reports elsewhere]

bus/systemd-user/dbus.socket.in
configure.ac

index 77958f7c3df9bd661c1737f7abf9442fe5198945..4793d1d4ff1dc13ef646053bfada192b4a06ff67 100644 (file)
@@ -3,6 +3,7 @@ Description=D-Bus User Message Bus Socket
 
 [Socket]
 ListenStream=%t/bus
+ExecStartPost=-@SYSTEMCTL@ --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
 
 [Install]
 WantedBy=sockets.target
index da14b704f1ca56f48b9cc679b1c2e731c6961aad..cfb9034ee6d82b861bee88fb201ef45a5b6c30c8 100644 (file)
@@ -1202,6 +1202,12 @@ if test x$enable_systemd = xyes -a x$have_systemd != xyes ; then
     AC_MSG_ERROR([Explicitly requested systemd support, but systemd not found])
 fi
 
+# If not found in $PATH, we might still have systemd and systemctl at runtime
+# (perhaps dbus is being compiled in a minimal chroot with no systemd).
+# Assume the upstream-recommended location. Distributors with split /usr
+# can override this with ./configure SYSTEMCTL=/bin/systemctl
+AC_PATH_PROG([SYSTEMCTL], [systemctl], [/usr/bin/systemctl])
+
 # libaudit detection
 if test x$enable_libaudit = xno ; then
     have_libaudit=no;