summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2020-12-04 11:11:04 +0000
committerSimon McVittie <smcv@debian.org>2020-12-04 11:14:11 +0000
commitfc46e157bd708aa24ee366e027aa7edbaa0c8648 (patch)
tree4b68553e3d6a225b0efa027a876f4a3f4f953f67 /meson.build
parent490421c6a89f918dbb75ae14efb66a1ce1fe1399 (diff)
downloaddconf-wip/smcv/systemd-unit.tar.gz
service: Add a systemd unit for D-Bus activationwip/smcv/systemd-unit
On systems using systemd --user and dbus-daemon --session --systemd-activation, this means that dconf is correctly placed in its own cgroup, instead of being part of dbus.service's cgroup. This allows it to be controlled by systemctl --user, have resource limits set and so on. On other systems (in particular those where systemd is not used at all), the SystemdService field is ignored and dbus-daemon will continue to start dconf-service as its own child process ("traditional activation"), making this change harmless to apply. Resolves: https://gitlab.gnome.org/GNOME/dconf/-/issues/24 Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build14
1 files changed, 14 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 41fe1a9..6e88015 100644
--- a/meson.build
+++ b/meson.build
@@ -48,6 +48,20 @@ glib_dep = dependency('glib-2.0', version: '>= 2.44.0')
gio_module_dir = gio_dep.get_pkgconfig_variable('giomoduledir', define_variable: ['libdir', dconf_libdir])
dbus_session_service_dir = dependency('dbus-1').get_pkgconfig_variable('session_bus_services_dir', define_variable: ['datadir', dconf_datadir])
+systemd_userunitdir = get_option('systemduserunitdir')
+
+if systemd_userunitdir == ''
+ systemd_dep = dependency('systemd', required: false)
+
+ if systemd_dep.found()
+ systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
+ else
+ # Fall back to the upstream default.
+ # Note that this is always 'lib', even if libdir is something else
+ systemd_userunitdir = join_paths(dconf_prefix, 'lib', 'systemd', 'user')
+ endif
+endif
+
enable_bash_completion = get_option('bash_completion')
if enable_bash_completion
bash_completion_dep = dependency('bash-completion')