summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bus/systemd-user/dbus.socket.in1
-rw-r--r--configure.ac6
2 files changed, 7 insertions, 0 deletions
diff --git a/bus/systemd-user/dbus.socket.in b/bus/systemd-user/dbus.socket.in
index 77958f7c..4793d1d4 100644
--- a/bus/systemd-user/dbus.socket.in
+++ b/bus/systemd-user/dbus.socket.in
@@ -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
diff --git a/configure.ac b/configure.ac
index da14b704..cfb9034e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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;