tizen: Add additional unit for "unified" user session 28/204128/1
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Fri, 19 Apr 2019 08:51:11 +0000 (10:51 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Fri, 19 Apr 2019 13:32:35 +0000 (15:32 +0200)
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: I232c8be6cc6fce07ae694d5b0ac2f08d8b98c3a0

bus/at-spi-dbus-bus@.service.in [new file with mode: 0644]
bus/meson.build
meson.build
meson_options.txt
packaging/at-spi2-core.spec

diff --git a/bus/at-spi-dbus-bus@.service.in b/bus/at-spi-dbus-bus@.service.in
new file mode 100644 (file)
index 0000000..f8543d3
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+PartOf=userlogin@%i.target
+Description=Accessibility services bus
+
+[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
+Type=dbus
+BusName=org.a11y.Bus
+ExecStart=@libexecdir@/at-spi-bus-launcher
index 75c6591..21e453e 100644 (file)
@@ -31,6 +31,12 @@ configure_file(input: 'at-spi-dbus-bus.service.in',
                install: true,
                install_dir: systemd_user_dir)
 
+configure_file(input: 'at-spi-dbus-bus@.service.in',
+               output: 'at-spi-dbus-bus@.service',
+               configuration: libexec_conf,
+               install: true,
+               install_dir: systemd_system_dir)
+
 launcher_args = [
              '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir),
              '-DDATADIR="@0@"'.format(atspi_datadir),
index ab48912..7eaa416 100644 (file)
@@ -42,6 +42,12 @@ else
   systemd_user_dir = join_paths(get_option('prefix'), 'lib/systemd/user')
 endif
 
+if get_option('systemd_system_dir') != 'default'
+  systemd_system_dir = get_option('systemd_system_dir')
+else
+  systemd_system_dir = join_paths(get_option('prefix'), 'lib/systemd/system')
+endif
+
 # Dependencies
 libdbus_req_version = '>= 1.5'
 glib_req_version = '>= 2.32.0'
index f8ec862..4ff7d5e 100644 (file)
@@ -19,6 +19,10 @@ option('systemd_user_dir',
        description: 'Location of the systemd user services',
        type: 'string',
        value: 'default')
+option('systemd_system_dir',
+       description: 'Location of the systemd system services',
+       type: 'string',
+       value: 'default')
 option('enable_docs',
        description: 'Generate API reference for atspi (requires GTK-Doc)',
        type: 'boolean',
index 7981bc8..f9af8d2 100644 (file)
@@ -112,6 +112,7 @@ rm -fr %{buildroot}
 %{_datadir}/dbus-1/accessibility-services/org.a11y.atspi.Registry.service
 %{_datadir}/dbus-1/services/org.a11y.Bus.service
 %{_prefix}/lib/systemd/user/at-spi-dbus-bus.service
+%{_prefix}/lib/systemd/system/at-spi-dbus-bus@.service
 %files -n libatspi0
 %manifest %{name}.manifest
 %defattr(-, root, root)