From: Simon McVittie Date: Mon, 28 Sep 2015 16:39:17 +0100 Subject: Add a systemd user unit for the two D-Bus session services Similar to Bug #12225, when running under a systemd user session, this results in thunar instances that are D-Bus-activated being placed in their own cgroup, whereas previously they would be a child of dbus-daemon in the dbus.service cgroup. It also avoids races between two separate instances of the same executable being started for its two activatable names, which could result in spurious activation failures if they are used in quick succession, similar to in telepathy-mission-control. --- Makefile.am | 7 +++++++ org.xfce.FileManager.service.in | 1 + org.xfce.Thunar.service.in | 1 + thunar.service.in | 10 ++++++++++ 4 files changed, 19 insertions(+) create mode 100644 thunar.service.in diff --git a/Makefile.am b/Makefile.am index cca7c3b..2469b8a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -82,6 +82,11 @@ if HAVE_DBUS servicedir = $(datadir)/dbus-1/services service_in_files = org.xfce.FileManager.service.in org.xfce.Thunar.service.in service_DATA = $(service_in_files:.service.in=.service) + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_in_files = thunar.service.in +systemd_user_DATA = $(systemd_user_in_files:.service.in=.service) + %.service: %.service.in $(AM_V_GEN) $(SED) -e "s,\@bindir\@,$(bindir),g" < $< > $@ endif @@ -104,6 +109,7 @@ EXTRA_DIST = \ intltool-update.in \ $(desktop_in_in_files) \ $(service_in_files) \ + $(systemd_user_in_files) \ $(appdata_in_files) \ $(polkit_in_in_files) @@ -117,6 +123,7 @@ DISTCLEANFILES = \ $(desktop_in_files) \ $(desktop_DATA) \ $(service_DATA) \ + $(systemd_user_DATA) \ $(polkit_in_files) \ $(polkit_policy_DATA) diff --git a/org.xfce.FileManager.service.in b/org.xfce.FileManager.service.in index adbacf1..c6572c0 100644 --- a/org.xfce.FileManager.service.in +++ b/org.xfce.FileManager.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.xfce.FileManager Exec=@bindir@/Thunar --daemon +SystemdService=thunar.service diff --git a/org.xfce.Thunar.service.in b/org.xfce.Thunar.service.in index 7d0aff8..0186da7 100644 --- a/org.xfce.Thunar.service.in +++ b/org.xfce.Thunar.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.xfce.Thunar Exec=@bindir@/Thunar --daemon +SystemdService=thunar.service diff --git a/thunar.service.in b/thunar.service.in new file mode 100644 index 0000000..5b5203b --- /dev/null +++ b/thunar.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Thunar file manager +Documentation=man:Thunar(1) + +[Service] +Type=dbus +ExecStart=@bindir@/Thunar --daemon +# This is the name that is taken second, so by the time this one is taken, +# we know everything is good. +BusName=org.xfce.FileManager