summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bus/Makefile.am16
-rw-r--r--bus/systemd-user/dbus.service.in11
-rw-r--r--bus/systemd-user/dbus.socket.in9
-rw-r--r--configure.ac19
4 files changed, 54 insertions, 1 deletions
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 1db7c9e..ac2b4fc 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -250,6 +250,10 @@ if HAVE_SYSTEMD
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
endif
+if DBUS_ENABLE_USER_SESSION
+ $(mkinstalldirs) $(DESTDIR)$(systemduserunitdir)/sockets.target.wants
+ ln -fs ../dbus.socket $(DESTDIR)$(systemduserunitdir)/sockets.target.wants/dbus.socket
+endif
if DBUS_UNIX
install-exec-hook:
@@ -301,13 +305,23 @@ endif
if HAVE_SYSTEMD
SCRIPT_IN_FILES += \
dbus.service.in \
- dbus.socket.in
+ dbus.socket.in \
+ systemd-user/dbus.service.in \
+ systemd-user/dbus.socket.in \
+ $(NULL)
systemdsystemunit_DATA = \
dbus.service \
dbus.socket
endif
+if DBUS_ENABLE_USER_SESSION
+systemduserunit_DATA = \
+ systemd-user/dbus.service \
+ systemd-user/dbus.socket \
+ $(NULL)
+endif
+
#### Extra dist
EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
diff --git a/bus/systemd-user/dbus.service.in b/bus/systemd-user/dbus.service.in
new file mode 100644
index 0000000..b41f522
--- /dev/null
+++ b/bus/systemd-user/dbus.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=D-Bus User Message Bus
+Documentation=man:dbus-daemon(1)
+Requires=dbus.socket
+
+[Service]
+ExecStart=@EXPANDED_BINDIR@/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
+ExecReload=@EXPANDED_BINDIR@/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
+
+[Install]
+Also=dbus.socket
diff --git a/bus/systemd-user/dbus.socket.in b/bus/systemd-user/dbus.socket.in
new file mode 100644
index 0000000..77958f7
--- /dev/null
+++ b/bus/systemd-user/dbus.socket.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=D-Bus User Message Bus Socket
+
+[Socket]
+ListenStream=%t/bus
+
+[Install]
+WantedBy=sockets.target
+Also=dbus.service
diff --git a/configure.ac b/configure.ac
index ac3ae26..303bc34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1560,6 +1560,16 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" != "xno" -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+AC_ARG_WITH([systemduserunitdir],
+AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
+ [],
+ [
+ PKG_CHECK_EXISTS([systemd],
+ [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)],
+ [with_systemduserunitdir='${libdir}/systemd/user'])
+ ])
+AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
+
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
DBUS_SYSTEM_SOCKET=$with_system_socket
@@ -1813,6 +1823,13 @@ if test "x$enable_stats" = xyes; then
[Define to enable bus daemon usage statistics])
fi
+AC_ARG_ENABLE([user-session],
+ [AS_HELP_STRING([--enable-user-session],
+ [enable user-session semantics for session bus under systemd])],
+ [], [enable_user_session=no])
+AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION],
+ [test "x$enable_user_session" = xyes])
+
AC_CONFIG_FILES([
Doxyfile
dbus/Version
@@ -1828,6 +1845,8 @@ bus/org.freedesktop.dbus-session.plist
bus/rc.messagebus
bus/dbus.service
bus/dbus.socket
+bus/systemd-user/dbus.service
+bus/systemd-user/dbus.socket
Makefile
dbus/Makefile
bus/Makefile