diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-09-28 13:48:29 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-05-16 10:59:02 +0100 |
commit | 44eed827e27895a46f08f57693b859674cb7d141 (patch) | |
tree | 5194ac5c38a73d2a8ce35f1aa5662c8fcc244862 /src | |
parent | eb1f3d93a96ce583d5533bf0c45d859f94e221b3 (diff) | |
download | tracker-44eed827e27895a46f08f57693b859674cb7d141.tar.gz |
Add systemd user services corresponding to D-Bus session services
The one exception is the email miner, which does not actually have
anything to start, so its D-Bus service file won't work anyway.
Restart the services on failure, but do not after SIGKILL,
because that's what `tracker daemon --kill` (formerly
`tracker-control --kill`) does. systemd already treats SIGTERM
as a graceful exit which is not considered to be a failure.
Loosely based on a patch by Alban Crequy, which only applied
this to tracker-store and tracker-miner-fs, and did not have
the special handling for SIGKILL.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=755739
Reviewed-by: Carlos Garnacho
Diffstat (limited to 'src')
21 files changed, 139 insertions, 6 deletions
diff --git a/src/miners/apps/Makefile.am b/src/miners/apps/Makefile.am index c6a23d394..c39a05cf5 100644 --- a/src/miners/apps/Makefile.am +++ b/src/miners/apps/Makefile.am @@ -31,6 +31,12 @@ service_DATA = org.freedesktop.Tracker1.Miner.Applications.service INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u' @INTLTOOL_SERVICE_RULE@ +tracker-miner-apps.service: tracker-miner-apps.service.in Makefile + @sed -e "s|@libexecdir[@]|${libexecdir}|" $< > $@ + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-miner-apps.service + install-data-hook: $(MKDIR_P) "$(DESTDIR)$(datadir)/tracker/miners" && \ $(LN_S) -f "$(servicedir)/$(service_DATA)" \ @@ -55,8 +61,12 @@ CLEANFILES = \ $(autostart_DATA) \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ - $(service_DATA:.service=.service.in) + $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA) \ + $(NULL) EXTRA_DIST = \ $(autostart_DATA:.desktop=.desktop.in.in) \ - $(service_DATA:.service=.service.in.in) + $(service_DATA:.service=.service.in.in) \ + $(systemd_user_DATA:.service=.service.in) \ + $(NULL) diff --git a/src/miners/apps/org.freedesktop.Tracker1.Miner.Applications.service.in.in b/src/miners/apps/org.freedesktop.Tracker1.Miner.Applications.service.in.in index 100fb778c..9de0f9eb7 100644 --- a/src/miners/apps/org.freedesktop.Tracker1.Miner.Applications.service.in.in +++ b/src/miners/apps/org.freedesktop.Tracker1.Miner.Applications.service.in.in @@ -1,6 +1,7 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Miner.Applications Exec=@libexecdir@/tracker-miner-apps +SystemdService=tracker-miner-apps.service # Miner details needed for tracker-control Path=/org/freedesktop/Tracker1/Miner/Applications diff --git a/src/miners/apps/tracker-miner-apps.service.in b/src/miners/apps/tracker-miner-apps.service.in new file mode 100644 index 000000000..49b78c0a5 --- /dev/null +++ b/src/miners/apps/tracker-miner-apps.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker applications data miner + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Miner.Applications +ExecStart=@libexecdir@/tracker-miner-apps +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am index 73978d49a..75060f169 100644 --- a/src/miners/fs/Makefile.am +++ b/src/miners/fs/Makefile.am @@ -67,6 +67,12 @@ service_DATA = org.freedesktop.Tracker1.Miner.Files.service INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u' @INTLTOOL_SERVICE_RULE@ +tracker-miner-fs.service: tracker-miner-fs.service.in Makefile + @sed -e "s|@libexecdir[@]|${libexecdir}|" $< > $@ + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-miner-fs.service + install-data-hook: $(MKDIR_P) "$(DESTDIR)$(datadir)/tracker/miners" && \ $(LN_S) -f "$(servicedir)/$(service_DATA)" \ @@ -108,6 +114,7 @@ CLEANFILES = \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA) \ $(gsettings_SCHEMAS) \ $(man_MANS) @@ -115,6 +122,7 @@ EXTRA_DIST = \ $(autostart_DATA:.desktop=.desktop.in.in) \ $(config_DATA) \ $(service_DATA:.service=.service.in.in) \ + $(systemd_user_DATA:.service=.service.in) \ $(gsettings_SCHEMAS:.xml=.xml.in) \ $(man_MANS) diff --git a/src/miners/fs/org.freedesktop.Tracker1.Miner.Files.service.in.in b/src/miners/fs/org.freedesktop.Tracker1.Miner.Files.service.in.in index 1a285d93f..009302b4d 100644 --- a/src/miners/fs/org.freedesktop.Tracker1.Miner.Files.service.in.in +++ b/src/miners/fs/org.freedesktop.Tracker1.Miner.Files.service.in.in @@ -1,6 +1,7 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Miner.Files Exec=@libexecdir@/tracker-miner-fs +SystemdService=tracker-miner-fs.service # Miner details needed for tracker-control Path=/org/freedesktop/Tracker1/Miner/Files diff --git a/src/miners/fs/tracker-miner-fs.service.in b/src/miners/fs/tracker-miner-fs.service.in new file mode 100644 index 000000000..fad973a04 --- /dev/null +++ b/src/miners/fs/tracker-miner-fs.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker file system data miner + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Miner.Files +ExecStart=@libexecdir@/tracker-miner-fs +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/miners/rss/Makefile.am b/src/miners/rss/Makefile.am index c63ebcd06..7a1e569fe 100644 --- a/src/miners/rss/Makefile.am +++ b/src/miners/rss/Makefile.am @@ -31,6 +31,12 @@ service_DATA = org.freedesktop.Tracker1.Miner.RSS.service INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u' @INTLTOOL_SERVICE_RULE@ +tracker-miner-rss.service: tracker-miner-rss.service.in Makefile + @sed -e "s|@libexecdir[@]|${libexecdir}|" $< > $@ + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-miner-rss.service + install-data-hook: $(MKDIR_P) "$(DESTDIR)$(datadir)/tracker/miners" && \ $(LN_S) -f "$(servicedir)/$(service_DATA)" \ @@ -55,8 +61,12 @@ CLEANFILES = \ $(autostart_DATA) \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ - $(service_DATA:.service=.service.in) + $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA) \ + $(NULL) EXTRA_DIST = \ $(autostart_DATA:.desktop=.desktop.in.in) \ - $(service_DATA:.service=.service.in.in) + $(service_DATA:.service=.service.in.in) \ + $(systemd_user_DATA:.service=.service.in) \ + $(NULL) diff --git a/src/miners/rss/org.freedesktop.Tracker1.Miner.RSS.service.in.in b/src/miners/rss/org.freedesktop.Tracker1.Miner.RSS.service.in.in index 860d2c66d..7b59ba359 100644 --- a/src/miners/rss/org.freedesktop.Tracker1.Miner.RSS.service.in.in +++ b/src/miners/rss/org.freedesktop.Tracker1.Miner.RSS.service.in.in @@ -1,6 +1,7 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Miner.RSS Exec=@libexecdir@/tracker-miner-rss +SystemdService=tracker-miner-rss.service # Miner details needed for tracker-control Path=/org/freedesktop/Tracker1/Miner/RSS diff --git a/src/miners/rss/tracker-miner-rss.service.in b/src/miners/rss/tracker-miner-rss.service.in new file mode 100644 index 000000000..2bebf4cf5 --- /dev/null +++ b/src/miners/rss/tracker-miner-rss.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker RSS/ATOM feed data miner + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Miner.RSS +ExecStart=@libexecdir@/tracker-miner-rss +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/miners/user-guides/Makefile.am b/src/miners/user-guides/Makefile.am index 767ed7b6f..b66194e7f 100644 --- a/src/miners/user-guides/Makefile.am +++ b/src/miners/user-guides/Makefile.am @@ -31,6 +31,12 @@ service_DATA = org.freedesktop.Tracker1.Miner.Userguides.service INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u' @INTLTOOL_SERVICE_RULE@ +tracker-miner-user-guides.service: tracker-miner-user-guides.service.in Makefile + @sed -e "s|@libexecdir[@]|${libexecdir}|" $< > $@ + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-miner-user-guides.service + install-data-hook: $(MKDIR_P) "$(DESTDIR)$(datadir)/tracker/miners" && \ $(LN_S) -f "$(servicedir)/$(service_DATA)" \ @@ -55,8 +61,12 @@ CLEANFILES = \ $(autostart_DATA) \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ - $(service_DATA:.service=.service.in) + $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA) \ + $(NULL) EXTRA_DIST = \ $(autostart_DATA:.desktop=.desktop.in.in) \ - $(service_DATA:.service=.service.in.in) + $(service_DATA:.service=.service.in.in) \ + $(systemd_user_DATA:.service=.service.in) \ + $(NULL) diff --git a/src/miners/user-guides/org.freedesktop.Tracker1.Miner.Userguides.service.in.in b/src/miners/user-guides/org.freedesktop.Tracker1.Miner.Userguides.service.in.in index 2f4857038..047ed0fd7 100644 --- a/src/miners/user-guides/org.freedesktop.Tracker1.Miner.Userguides.service.in.in +++ b/src/miners/user-guides/org.freedesktop.Tracker1.Miner.Userguides.service.in.in @@ -1,6 +1,7 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Miner.Userguides Exec=@libexecdir@/tracker-miner-user-guides +SystemdService=tracker-miner-user-guides.service # Miner details needed for tracker-control Path=/org/freedesktop/Tracker1/Miner/Userguides diff --git a/src/miners/user-guides/tracker-miner-user-guides.service.in b/src/miners/user-guides/tracker-miner-user-guides.service.in new file mode 100644 index 000000000..34f82dfab --- /dev/null +++ b/src/miners/user-guides/tracker-miner-user-guides.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker user guides data miner + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Miner.UserGuides +ExecStart=@libexecdir@/tracker-miner-user-guides +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am index 3ccc2d08c..1f800a435 100644 --- a/src/tracker-extract/Makefile.am +++ b/src/tracker-extract/Makefile.am @@ -585,6 +585,12 @@ service_DATA = org.freedesktop.Tracker1.Miner.Extract.service INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u' @INTLTOOL_SERVICE_RULE@ +tracker-extract.service: tracker-extract.service.in Makefile + @sed -e "s|@libexecdir[@]|${libexecdir}|" $< > $@ + +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-extract.service + install-data-hook: $(MKDIR_P) "$(DESTDIR)$(datadir)/tracker/miners" && \ $(LN_S) -f "$(servicedir)/$(service_DATA)" \ @@ -620,6 +626,7 @@ CLEANFILES += \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA) \ $(gsettings_SCHEMAS) \ $(man_MANS) @@ -627,5 +634,6 @@ EXTRA_DIST += \ $(autostart_DATA:.desktop=.desktop.in.in) \ $(config_DATA) \ $(service_DATA:.service=.service.in.in) \ + $(systemd_user_DATA:.service=.service.in) \ $(gsettings_SCHEMAS:.xml=.xml.in) \ $(man_MANS) diff --git a/src/tracker-extract/org.freedesktop.Tracker1.Miner.Extract.service.in.in b/src/tracker-extract/org.freedesktop.Tracker1.Miner.Extract.service.in.in index 5c4ad1411..e436faa76 100644 --- a/src/tracker-extract/org.freedesktop.Tracker1.Miner.Extract.service.in.in +++ b/src/tracker-extract/org.freedesktop.Tracker1.Miner.Extract.service.in.in @@ -1,6 +1,7 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Miner.Extract Exec=@libexecdir@/tracker-extract +SystemdService=tracker-extract.service # Miner details needed for tracker-control Path=/org/freedesktop/Tracker1/Miner/Extract diff --git a/src/tracker-extract/tracker-extract.service.in b/src/tracker-extract/tracker-extract.service.in new file mode 100644 index 000000000..b7bc6c140 --- /dev/null +++ b/src/tracker-extract/tracker-extract.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker metadata extractor + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Miner.Extract +ExecStart=@libexecdir@/tracker-extract +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am index d7a6b86e6..07eb557e5 100644 --- a/src/tracker-store/Makefile.am +++ b/src/tracker-store/Makefile.am @@ -76,6 +76,9 @@ config_DATA = \ servicedir = $(DBUS_SERVICES_DIR) service_DATA = org.freedesktop.Tracker1.service +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-store.service + # Desktop files: First we fix the VERSION and libexecdir %.desktop.in: %.desktop.in.in @sed -e "s|@libexecdir[@]|${libexecdir}|" \ @@ -104,12 +107,14 @@ CLEANFILES = \ $(autostart_DATA) \ $(autostart_DATA:.desktop=.desktop.in) \ $(service_DATA) \ + $(systemd_user_DATA) \ $(gsettings_SCHEMAS) \ $(man_MANS) EXTRA_DIST += \ $(autostart_DATA:.desktop=.desktop.in.in) \ $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA:.service=.service.in) \ $(config_DATA) \ $(gsettings_SCHEMAS:.xml=.xml.in) \ $(man_MANS) diff --git a/src/tracker-store/org.freedesktop.Tracker1.service.in b/src/tracker-store/org.freedesktop.Tracker1.service.in index 77edc00be..d8342738f 100644 --- a/src/tracker-store/org.freedesktop.Tracker1.service.in +++ b/src/tracker-store/org.freedesktop.Tracker1.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.freedesktop.Tracker1 Exec=@libexecdir@/tracker-store +SystemdService=tracker-store.service diff --git a/src/tracker-store/tracker-store.service.in b/src/tracker-store/tracker-store.service.in new file mode 100644 index 000000000..86af15702 --- /dev/null +++ b/src/tracker-store/tracker-store.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker metadata database store and lookup manager + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1 +ExecStart=/usr/lib/tracker/tracker-store +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL diff --git a/src/tracker-writeback/Makefile.am b/src/tracker-writeback/Makefile.am index 94110cf3d..b4849c1ff 100644 --- a/src/tracker-writeback/Makefile.am +++ b/src/tracker-writeback/Makefile.am @@ -70,6 +70,9 @@ config_DATA = tracker-writeback.xml servicedir = $(DBUS_SERVICES_DIR) service_DATA = org.freedesktop.Tracker1.Writeback.service +systemd_userdir = $(prefix)/lib/systemd/user +systemd_user_DATA = tracker-writeback.service + # Configuration / GSettings gsettings_ENUM_NAMESPACE = org.freedesktop.Tracker gsettings_ENUM_FILES = $(top_srcdir)/src/libtracker-common/tracker-enums.h @@ -83,11 +86,13 @@ gsettings_SCHEMAS = org.freedesktop.Tracker.Writeback.gschema.xml # Dist / Clean rules for all data CLEANFILES = \ $(service_DATA) \ + $(systemd_user_DATA) \ $(gsettings_SCHEMAS) \ $(man_MANS) EXTRA_DIST = \ $(service_DATA:.service=.service.in) \ + $(systemd_user_DATA:.service=.service.in) \ $(config_DATA) \ $(gsettings_SCHEMAS:.xml=.xml.in) \ $(man_MANS) diff --git a/src/tracker-writeback/org.freedesktop.Tracker1.Writeback.service.in b/src/tracker-writeback/org.freedesktop.Tracker1.Writeback.service.in index a6924709b..81a2ec271 100644 --- a/src/tracker-writeback/org.freedesktop.Tracker1.Writeback.service.in +++ b/src/tracker-writeback/org.freedesktop.Tracker1.Writeback.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.freedesktop.Tracker1.Writeback Exec=@libexecdir@/tracker-writeback +SystemdService=tracker-writeback.service diff --git a/src/tracker-writeback/tracker-writeback.service.in b/src/tracker-writeback/tracker-writeback.service.in new file mode 100644 index 000000000..bcb6ac1b8 --- /dev/null +++ b/src/tracker-writeback/tracker-writeback.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Tracker data writeback service + +[Service] +Type=dbus +BusName=org.freedesktop.Tracker1.Writeback +ExecStart=@libexecdir@/tracker-writeback +Restart=on-failure +# Don't restart after tracker daemon -k (aka tracker-control -k) +RestartPreventExitStatus=SIGKILL |