From: Simon McVittie Date: Thu, 24 Sep 2015 17:32:24 +0100 Subject: Add a systemd user service corresponding to the D-Bus session service This ensures that it ends up in its own cgroup under systemd user sessions where dbus-daemon uses systemd activation, rather than being treated as part of dbus.service. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92165 --- contrib/session-helper/Makefile.am | 8 ++++++++ contrib/session-helper/colord-session.service.in | 7 +++++++ contrib/session-helper/org.freedesktop.ColorHelper.service.in | 1 + 3 files changed, 16 insertions(+) create mode 100644 contrib/session-helper/colord-session.service.in diff --git a/contrib/session-helper/Makefile.am b/contrib/session-helper/Makefile.am index 06a4bda..9f45753 100644 --- a/contrib/session-helper/Makefile.am +++ b/contrib/session-helper/Makefile.am @@ -62,6 +62,12 @@ $(dbusservicemain_DATA): $(dbusservicemain_in_files) Makefile @sed -e "s|\@servicedir\@|$(libexecdir)|" $< | \ sed -e "s|\@daemon_user\@|$(daemon_user)|" > $@ +systemduserdir = $(prefix)/lib/systemd/user +systemduser_in_files = colord-session.service.in +systemduser_DATA = $(systemduser_in_files:.service.in=.service) +$(systemduser_DATA): $(systemduser_in_files) Makefile + @sed -e "s|\@servicedir\@|$(libexecdir)|" $< > $@ + if CD_BUILD_SESSION_EXAMPLE noinst_PROGRAMS = \ colord-session-example @@ -93,10 +99,12 @@ gsettings_SCHEMAS = $(gsettings_schemas_in_files:.gschema.xml.in=.gschema.xml) EXTRA_DIST = \ $(gsettings_schemas_in_files) \ + $(systemduser_in_files) \ $(dbusservicemain_in_files) DISTCLEANFILES = \ $(dbusservicemain_DATA) \ + $(systemduser_DATA) \ org.freedesktop.ColorHelper.gschema.xml -include $(top_srcdir)/git.mk diff --git a/contrib/session-helper/colord-session.service.in b/contrib/session-helper/colord-session.service.in new file mode 100644 index 0000000..086a8fd --- /dev/null +++ b/contrib/session-helper/colord-session.service.in @@ -0,0 +1,7 @@ +[Unit] +Description=Color management helper + +[Service] +Type=dbus +BusName=org.freedesktop.ColorHelper +ExecStart=@servicedir@/colord-session diff --git a/contrib/session-helper/org.freedesktop.ColorHelper.service.in b/contrib/session-helper/org.freedesktop.ColorHelper.service.in index abcfb7f..28a8568 100644 --- a/contrib/session-helper/org.freedesktop.ColorHelper.service.in +++ b/contrib/session-helper/org.freedesktop.ColorHelper.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.freedesktop.ColorHelper Exec=@servicedir@/colord-session +SystemdService=colord-session.service