[evolution-data-server] Bug 755735 - Add a systemd user service for each D-Bus session service
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 755735 - Add a systemd user service for each D-Bus session service
- Date: Fri, 2 Oct 2015 05:32:48 +0000 (UTC)
commit 51a37f76bec193847f0ec2c5df4aa879947a47c2
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Fri Oct 2 07:31:20 2015 +0200
Bug 755735 - Add a systemd user service for each D-Bus session service
This means each service will run in its own cgroup under a systemd
user session, instead of being a child of dbus-daemon that is
considered to be part of dbus.service. It does not cause the
services to be started on login: they are still started on-demand
by bus activation.
The files installation can be disabled with configure
a option --without-systemduserunitdir.
configure.ac | 11 +++++++++++
services/evolution-addressbook-factory/Makefile.am | 9 +++++++++
.../evolution-addressbook-factory.service.in | 7 +++++++
...ome.evolution.dataserver.AddressBook.service.in | 1 +
services/evolution-calendar-factory/Makefile.am | 9 +++++++++
.../evolution-calendar-factory.service.in | 7 +++++++
....gnome.evolution.dataserver.Calendar.service.in | 1 +
services/evolution-source-registry/Makefile.am | 9 +++++++++
.../evolution-source-registry.service.in | 7 +++++++
...g.gnome.evolution.dataserver.Sources.service.in | 1 +
services/evolution-user-prompter/Makefile.am | 9 +++++++++
.../evolution-user-prompter.service.in | 7 +++++++
...me.evolution.dataserver.UserPrompter.service.in | 1 +
13 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7ca4aff..abe4f65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1745,6 +1745,17 @@ AC_ARG_WITH([dbus-service-dir],
[dbus_servicedir='${datadir}/dbus-1/services'])
AC_SUBST([dbus_servicedir])
+# It is correct for this to be in ${prefix}/lib, even on systems where that
+# does not match ${libdir}. This is what systemd uses on such platforms.
+AC_ARG_WITH([systemduserunitdir],
+ AS_HELP_STRING([--with-systemduserunitdir=PATH],
+ [Set directory for systemd user units, or 'no' to disable]
+ [[default=${prefix}/lib/systemd/user]]),
+ [systemd_userdir="$withval"],
+ [systemd_userdir='${prefix}/lib/systemd/user'])
+AC_SUBST([systemd_userdir])
+AM_CONDITIONAL([WITH_SYSTEMD_USER_UNITS], [test "x$systemd_userdir" != "xno"])
+
dnl ******************************
dnl GLib stuff
dnl ******************************
diff --git a/services/evolution-addressbook-factory/Makefile.am
b/services/evolution-addressbook-factory/Makefile.am
index 00eaa0c..d9ef290 100644
--- a/services/evolution-addressbook-factory/Makefile.am
+++ b/services/evolution-addressbook-factory/Makefile.am
@@ -2,13 +2,22 @@ NULL =
dbus_service_in_files = org.gnome.evolution.dataserver.AddressBook.service.in
dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+systemd_user_in_files = evolution-addressbook-factory.service.in
+if WITH_SYSTEMD_USER_UNITS
+systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
+
+# this works for both D-Bus and systemd services
@EVO_SUBST_SERVICE_RULE@
CLEANFILES = \
$(dbus_service_DATA) \
+ $(systemd_user_DATA) \
$(NULL)
EXTRA_DIST = \
$(dbus_service_in_files) \
+ $(systemd_user_in_files) \
$(NULL)
libexec_PROGRAMS = evolution-addressbook-factory
diff --git a/services/evolution-addressbook-factory/evolution-addressbook-factory.service.in
b/services/evolution-addressbook-factory/evolution-addressbook-factory.service.in
new file mode 100644
index 0000000..172b363
--- /dev/null
+++ b/services/evolution-addressbook-factory/evolution-addressbook-factory.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Evolution address book service
+
+[Service]
+Type=dbus
+BusName= ADDRESS_BOOK_DBUS_SERVICE_NAME@
+ExecStart= libexecdir@/evolution-addressbook-factory
diff --git a/services/evolution-addressbook-factory/org.gnome.evolution.dataserver.AddressBook.service.in
b/services/evolution-addressbook-factory/org.gnome.evolution.dataserver.AddressBook.service.in
index 84c346c..e5a05b8 100644
--- a/services/evolution-addressbook-factory/org.gnome.evolution.dataserver.AddressBook.service.in
+++ b/services/evolution-addressbook-factory/org.gnome.evolution.dataserver.AddressBook.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name= ADDRESS_BOOK_DBUS_SERVICE_NAME@
Exec= libexecdir@/evolution-addressbook-factory
+SystemdService=evolution-addressbook-factory.service
diff --git a/services/evolution-calendar-factory/Makefile.am b/services/evolution-calendar-factory/Makefile.am
index 153d1b9..cc781f2 100644
--- a/services/evolution-calendar-factory/Makefile.am
+++ b/services/evolution-calendar-factory/Makefile.am
@@ -2,14 +2,23 @@ NULL =
dbus_service_in_files = org.gnome.evolution.dataserver.Calendar.service.in
dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+systemd_user_in_files = evolution-calendar-factory.service.in
+if WITH_SYSTEMD_USER_UNITS
+systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
+
+# this works for both D-Bus and systemd services
@EVO_SUBST_SERVICE_RULE@
CLEANFILES = \
$(dbus_service_DATA) \
+ $(systemd_user_DATA) \
$(NULL)
EXTRA_DIST = \
$(dbus_service_in_files) \
+ $(systemd_user_in_files) \
$(NULL)
libexec_PROGRAMS = evolution-calendar-factory
diff --git a/services/evolution-calendar-factory/evolution-calendar-factory.service.in
b/services/evolution-calendar-factory/evolution-calendar-factory.service.in
new file mode 100644
index 0000000..4271253
--- /dev/null
+++ b/services/evolution-calendar-factory/evolution-calendar-factory.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Evolution calendar service
+
+[Service]
+Type=dbus
+BusName= CALENDAR_DBUS_SERVICE_NAME@
+ExecStart= libexecdir@/evolution-calendar-factory
diff --git a/services/evolution-calendar-factory/org.gnome.evolution.dataserver.Calendar.service.in
b/services/evolution-calendar-factory/org.gnome.evolution.dataserver.Calendar.service.in
index c985b31..51dec95 100644
--- a/services/evolution-calendar-factory/org.gnome.evolution.dataserver.Calendar.service.in
+++ b/services/evolution-calendar-factory/org.gnome.evolution.dataserver.Calendar.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name= CALENDAR_DBUS_SERVICE_NAME@
Exec= libexecdir@/evolution-calendar-factory
+SystemdService=evolution-calendar-factory.service
diff --git a/services/evolution-source-registry/Makefile.am b/services/evolution-source-registry/Makefile.am
index cc1841c..26f451f 100644
--- a/services/evolution-source-registry/Makefile.am
+++ b/services/evolution-source-registry/Makefile.am
@@ -26,18 +26,27 @@ builtin_sources = $(builtin_sources_in_files:.source.in=.source)
dbus_service_in_files = org.gnome.evolution.dataserver.Sources.service.in
dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+systemd_user_in_files = evolution-source-registry.service.in
+if WITH_SYSTEMD_USER_UNITS
+systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
+
+# this works for both
@EVO_SUBST_SERVICE_RULE@
CLEANFILES = \
$(BUILT_SOURCES) \
$(builtin_sources) \
$(dbus_service_DATA) \
+ $(systemd_user_DATA) \
$(NULL)
EXTRA_DIST = \
evolution-source-registry-resource.xml \
$(builtin_sources_in_files) \
$(dbus_service_in_files) \
+ $(systemd_user_in_files) \
$(NULL)
libexec_PROGRAMS = \
diff --git a/services/evolution-source-registry/evolution-source-registry.service.in
b/services/evolution-source-registry/evolution-source-registry.service.in
new file mode 100644
index 0000000..0e6993c
--- /dev/null
+++ b/services/evolution-source-registry/evolution-source-registry.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Evolution source registry
+
+[Service]
+Type=dbus
+BusName= SOURCES_DBUS_SERVICE_NAME@
+ExecStart= libexecdir@/evolution-source-registry
diff --git a/services/evolution-source-registry/org.gnome.evolution.dataserver.Sources.service.in
b/services/evolution-source-registry/org.gnome.evolution.dataserver.Sources.service.in
index bc89d45..76f93f0 100644
--- a/services/evolution-source-registry/org.gnome.evolution.dataserver.Sources.service.in
+++ b/services/evolution-source-registry/org.gnome.evolution.dataserver.Sources.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name= SOURCES_DBUS_SERVICE_NAME@
Exec= libexecdir@/evolution-source-registry
+SystemdService=evolution-source-registry.service
diff --git a/services/evolution-user-prompter/Makefile.am b/services/evolution-user-prompter/Makefile.am
index 9a5e284..e850dfa 100644
--- a/services/evolution-user-prompter/Makefile.am
+++ b/services/evolution-user-prompter/Makefile.am
@@ -2,13 +2,22 @@ NULL =
dbus_service_in_files = org.gnome.evolution.dataserver.UserPrompter.service.in
dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+systemd_user_in_files = evolution-user-prompter.service.in
+if WITH_SYSTEMD_USER_UNITS
+systemd_user_DATA = $(systemd_user_in_files:.service.in=.service)
+endif
+
+# this works for both
@EVO_SUBST_SERVICE_RULE@
CLEANFILES = \
$(dbus_service_DATA) \
+ $(systemd_user_DATA) \
$(NULL)
EXTRA_DIST = \
$(dbus_service_in_files) \
+ $(systemd_user_in_files) \
$(NULL)
PROMPT_USER_SOURCES = prompt-user-gtk.c
diff --git a/services/evolution-user-prompter/evolution-user-prompter.service.in
b/services/evolution-user-prompter/evolution-user-prompter.service.in
new file mode 100644
index 0000000..7bd021c
--- /dev/null
+++ b/services/evolution-user-prompter/evolution-user-prompter.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Evolution user prompter
+
+[Service]
+Type=dbus
+BusName= USER_PROMPTER_DBUS_SERVICE_NAME@
+ExecStart= libexecdir@/evolution-user-prompter
diff --git a/services/evolution-user-prompter/org.gnome.evolution.dataserver.UserPrompter.service.in
b/services/evolution-user-prompter/org.gnome.evolution.dataserver.UserPrompter.service.in
index 5fd25e2..c66d861 100644
--- a/services/evolution-user-prompter/org.gnome.evolution.dataserver.UserPrompter.service.in
+++ b/services/evolution-user-prompter/org.gnome.evolution.dataserver.UserPrompter.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name= USER_PROMPTER_DBUS_SERVICE_NAME@
Exec= libexecdir@/evolution-user-prompter
+SystemdService=evolution-user-prompter.service
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]