summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-09-29 20:33:31 +0100
committerOndrej Holy <oholy@redhat.com>2015-09-30 15:20:37 +0200
commitdc7040d7f8b81658817b0a633092f85a4f4963fd (patch)
treeecf98324a51768bb4225351280ccb168215d2548 /daemon
parent957fff5be2b3cb2a3356955f5c51c94bcd256fed (diff)
downloadgvfs-dc7040d7f8b81658817b0a633092f85a4f4963fd.tar.gz
Add a corresponding systemd user service for every D-Bus session service
When using "systemd --user" in conjunction with "dbus-daemon --session --systemd-activation", this ensures that each daemon is correctly placed in its own cgroup, instead of being treated as part of dbus.service. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=755760
Diffstat (limited to 'daemon')
-rw-r--r--daemon/Makefile.am8
-rw-r--r--daemon/gvfs-daemon.service.in7
-rw-r--r--daemon/org.gtk.vfs.Daemon.service.in1
3 files changed, 15 insertions, 1 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index da3d7284..79113c71 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -31,7 +31,7 @@ gvfs_gschemas_convert =
gvfs_gschemas_dist =
gvfs_gschemas_convert_dist =
-# D-BUS service file
+# D-Bus and systemd service files
%.service: %.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
@@ -39,6 +39,10 @@ servicedir = $(DBUS_SERVICE_DIR)
service_in_files = org.gtk.vfs.Daemon.service.in
service_DATA = org.gtk.vfs.Daemon.service
+systemd_userdir = ${prefix}/lib/systemd/user
+systemd_user_in_files = gvfs-daemon.service.in
+systemd_user_DATA = gvfs-daemon.service
+
%.mount: %.mount.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
@@ -137,6 +141,7 @@ noinst_DATA = $(mount_DATA:.mount=.localmount)
EXTRA_DIST = \
$(service_in_files) \
+ $(systemd_user_in_files) \
$(mount_in_files) \
$(gvfs_gschemas_dist) \
$(gvfs_gschemas_convert_dist) \
@@ -148,6 +153,7 @@ DISTCLEANFILES = $(mount_DATA) $(noinst_DATA)
CLEANFILES = \
$(gsettings__enum_file) \
$(service_DATA) \
+ $(systemd_user_DATA) \
*.gschema.valid
noinst_PROGRAMS = \
diff --git a/daemon/gvfs-daemon.service.in b/daemon/gvfs-daemon.service.in
new file mode 100644
index 00000000..9f4abb5d
--- /dev/null
+++ b/daemon/gvfs-daemon.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Virtual filesystem service
+
+[Service]
+ExecStart=@libexecdir@/gvfsd
+Type=dbus
+BusName=org.gtk.vfs.Daemon
diff --git a/daemon/org.gtk.vfs.Daemon.service.in b/daemon/org.gtk.vfs.Daemon.service.in
index 00fe5315..fc25c3ab 100644
--- a/daemon/org.gtk.vfs.Daemon.service.in
+++ b/daemon/org.gtk.vfs.Daemon.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=org.gtk.vfs.Daemon
Exec=@libexecdir@/gvfsd
+SystemdService=gvfs-daemon.service