From c64ea0f61a0842c7b71c3ccb9018fd9dce088164 Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Fri, 19 Apr 2019 10:51:11 +0200 Subject: [PATCH] tizen: Add additional unit for "unified" user session 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 | 12 ++++++++++++ bus/meson.build | 6 ++++++ meson.build | 6 ++++++ meson_options.txt | 4 ++++ packaging/at-spi2-core.spec | 1 + 5 files changed, 29 insertions(+) create mode 100644 bus/at-spi-dbus-bus@.service.in diff --git a/bus/at-spi-dbus-bus@.service.in b/bus/at-spi-dbus-bus@.service.in new file mode 100644 index 0000000..f8543d3 --- /dev/null +++ b/bus/at-spi-dbus-bus@.service.in @@ -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 diff --git a/bus/meson.build b/bus/meson.build index 75c6591..21e453e 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -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), diff --git a/meson.build b/meson.build index ab48912..7eaa416 100644 --- a/meson.build +++ b/meson.build @@ -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' diff --git a/meson_options.txt b/meson_options.txt index f8ec862..4ff7d5e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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', diff --git a/packaging/at-spi2-core.spec b/packaging/at-spi2-core.spec index 7981bc8..f9af8d2 100644 --- a/packaging/at-spi2-core.spec +++ b/packaging/at-spi2-core.spec @@ -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) -- 2.7.4