summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>2019-04-19 12:53:02 +0200
committerINSUN PYO <insun.pyo@samsung.com>2019-05-07 17:29:19 +0900
commit662187a7597aaf9c9ad2a635944951e6174a36da (patch)
treeb528a2edf0c3e1273ae2ef889eeb6263f20be005
parent873bad7e9515fbafb8682fa6cdadfee629762e0d (diff)
downloaddbus-accepted/tizen/unified/20190510.111111.tar.gz
dbus-accepted/tizen/unified/20190510.111111.tar.bz2
dbus-accepted/tizen/unified/20190510.111111.zip
tizen: Add additional unit for "unified" user sessionsubmit/tizen/20190509.015828accepted/tizen/unified/20190510.111111
The unified user session is about moving user session units, managed by systemd --user, to main systemd, where it's managed as part of newly created user@.target. user@.target will contain same units as previously available in user/, with same UID and environment setup. systemd instance is used for unit to be able to specify UID (inherited from user@.target). The rationale behind this work is following: * VD requirement to remove user session support * boot time optimization requirements, due to: + 'systemd --user' taking 1s its own startup that could be used for unit startup + ability to better rearrange units if these managed by one systemd instance Unit installed by this commit will not be used till user login mechanism will be changed in systemd package (via changing pam_systemd to start user@.target, rather than user@.service). Change-Id: I524768f116ca91d812ae0884adbb300e52817975
-rw-r--r--bus/Makefile.am9
-rw-r--r--bus/systemd-system/dbus@.service.in17
-rw-r--r--bus/systemd-system/dbus@.socket.in12
-rw-r--r--configure.ac2
-rw-r--r--packaging/dbus.spec4
5 files changed, 43 insertions, 1 deletions
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 5f28a25f..6558ee14 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -264,6 +264,9 @@ endif
if DBUS_ENABLE_USER_SESSION
$(mkinstalldirs) $(DESTDIR)$(systemduserunitdir)/sockets.target.wants
ln -fs ../dbus.socket $(DESTDIR)$(systemduserunitdir)/sockets.target.wants/dbus.socket
+
+ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/user-sockets@.target.wants
+ ln -fs ../dbus@.socket $(DESTDIR)$(systemdsystemunitdir)/user-sockets@.target.wants/dbus@.socket
endif
if DBUS_UNIX
@@ -319,11 +322,15 @@ SCRIPT_IN_FILES += \
dbus.socket.in \
systemd-user/dbus.service.in \
systemd-user/dbus.socket.in \
+ systemd-system/dbus@.service.in \
+ systemd-system/dbus@.socket.in \
$(NULL)
systemdsystemunit_DATA = \
dbus.service \
- dbus.socket
+ dbus.socket \
+ systemd-system/dbus@.service \
+ systemd-system/dbus@.socket
endif
if DBUS_ENABLE_USER_SESSION
diff --git a/bus/systemd-system/dbus@.service.in b/bus/systemd-system/dbus@.service.in
new file mode 100644
index 00000000..e19b4435
--- /dev/null
+++ b/bus/systemd-system/dbus@.service.in
@@ -0,0 +1,17 @@
+[Unit]
+PartOf=userlogin@%i.target
+Description=D-Bus User Message Bus
+Documentation=man:dbus-daemon(1)
+DefaultDependencies=no
+Requires=dbus@%i.socket
+
+[Service]
+User=%i
+Environment=DBUS_SESSION_BUS_ADDRESS=kernel:path=/sys/fs/kdbus/%i-user/bus;unix:path=/run/user/%i/bus
+Environment=XDG_RUNTIME_DIR=/run/user/%i
+SmackProcessLabel=User
+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-system/dbus@.socket.in b/bus/systemd-system/dbus@.socket.in
new file mode 100644
index 00000000..0684b28d
--- /dev/null
+++ b/bus/systemd-system/dbus@.socket.in
@@ -0,0 +1,12 @@
+[Unit]
+PartOf=userlogin@%i.target
+DefaultDependencies=no
+After=systemd-logind.service
+Description=D-Bus User Message Bus Socket
+
+[Socket]
+SocketUser=%i
+ListenStream=/run/user/%i/bus
+
+[Install]
+Also=dbus.service
diff --git a/configure.ac b/configure.ac
index 2cc116aa..98e6833c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1923,6 +1923,8 @@ bus/dbus.service
bus/dbus.socket
bus/systemd-user/dbus.service
bus/systemd-user/dbus.socket
+bus/systemd-system/dbus@.service
+bus/systemd-system/dbus@.socket
Makefile
dbus/Makefile
bus/Makefile
diff --git a/packaging/dbus.spec b/packaging/dbus.spec
index 4f97865b..404a1230 100644
--- a/packaging/dbus.spec
+++ b/packaging/dbus.spec
@@ -340,6 +340,10 @@ popd
%{_unitdir_user}/dbus.service
%dir %{_unitdir_user}/sockets.target.wants
%{_unitdir_user}/sockets.target.wants/dbus.socket
+%{_unitdir}/dbus@.socket
+%{_unitdir}/dbus@.service
+%dir %{_unitdir}/user-sockets@.target.wants
+%{_unitdir}/user-sockets@.target.wants/dbus@.socket
%dir %{_sysconfdir}/dbus-1
%dir %{_datadir}/dbus-1/session.d
%dir %{_datadir}/dbus-1/system.d