From: Simon McVittie Date: Thu, 24 Sep 2015 12:51:48 +0100 Subject: Add a systemd user service This puts telepathy-gabble in its own cgroup, instead of being a child process of dbus-daemon in the dbus.service cgroup. --- data/Makefile.am | 17 +++++++++++++++-- data/gabble.service.in | 1 + data/telepathy-gabble.systemd.in | 7 +++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 data/telepathy-gabble.systemd.in diff --git a/data/Makefile.am b/data/Makefile.am index cf48bc1..7c611dc 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,7 @@ -EXTRA_DIST = gabble.service.in +EXTRA_DIST = \ + gabble.service.in \ + telepathy-gabble.systemd.in \ + $(NULL) managerdir = $(datadir)/telepathy/managers manager_DATA = gabble.manager @@ -6,6 +9,9 @@ manager_DATA = gabble.manager servicedir = $(datadir)/dbus-1/services service_DATA = org.freedesktop.Telepathy.ConnectionManager.gabble.service +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = telepathy-gabble.service + # We don't use the full filename for the .in because > 99 character filenames # in tarballs are non-portable (and automake 1.8 doesn't let us build # non-archaic tarballs) @@ -13,7 +19,14 @@ org.freedesktop.Telepathy.ConnectionManager.gabble.service: gabble.service.in \ Makefile $(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@ -CLEANFILES = $(service_DATA) $(manager_DATA) +telepathy-gabble.service: telepathy-gabble.systemd.in Makefile + $(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@ + +CLEANFILES = \ + $(manager_DATA) \ + $(service_DATA) \ + $(systemd_user_DATA) \ + $(NULL) $(manager_DATA): ../src/write-mgr-file.c ../src/protocol.c ../src/protocol.h @$(MAKE) -C ../src write-mgr-file$(EXEEXT) diff --git a/data/gabble.service.in b/data/gabble.service.in index 925e7a8..9719489 100644 --- a/data/gabble.service.in +++ b/data/gabble.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.freedesktop.Telepathy.ConnectionManager.gabble Exec=@libexecdir@/telepathy-gabble +SystemdService=telepathy-gabble.service diff --git a/data/telepathy-gabble.systemd.in b/data/telepathy-gabble.systemd.in new file mode 100644 index 0000000..c5d0356 --- /dev/null +++ b/data/telepathy-gabble.systemd.in @@ -0,0 +1,7 @@ +[Unit] +Description=Telepathy XMPP service + +[Service] +Type=dbus +BusName=org.freedesktop.Telepathy.ConnectionManager.gabble +ExecStart=@libexecdir@/telepathy-gabble