The mysterious case of Tracker...

Some of days ago I found a post on #Diaspora with this article:

https://www.linuxuprising.com/2019/07/how-to-completely-disable-tracker.html

And I am suddenly remembered about Tracker; It was by Gnome 2.6 that I don't uninstall an indexer on my computer... At that time there was an epic challenge between #Tracker and #Beagle to decide which was the crappiest, I suppose that Tracker won.

BeagleBeagle was made in Mono...

But I had totally forgot about them, as a matter of fact #Xfce4 on #Debian is distributed totally unbloated (not sure about #Xubuntu) so you don't to worry about that.

Trackers on #Gnu were born because OS X (today macOS) indexing system and Google Desktop, the latter is dead like happens at 98% of Gugl project while the former still continues to lurk inside any Apple operative systems. No one needs a file indexer on his/her computer in the way those are shaped, and we are again at the same stupid point... You encrypted your disk and later you indexing everything, it is not really coherent. I mean, if you decide to keep your data safe you must be consistent across all the status of your computer, indexing files is a generous help you are doing to anyone can access to your computer when it is fully accessible and you aren't there. Just think about it.

You may want tracking some special folders for you, that would be smarter, there are (or were) application available for that and probably also Tracker does it, and you may change the behavior on the setting but I am not really sure those changes will work; as a matter of by default it wants indexing all your system.

From that article I learned that eventually the performance issues have been fixed (probably 10 years later... 🤦‍♂️) but it has been also tied on Gnome3. The unknown reason about that. can only lead to think that was not for a good reason.


Before to continue

Blocking Tracker may break some application you use or you think you are going to use. Since the moment my default environment has been #XFCE4 I am not planning to replace my usual application with the Gnome ones hence I don't care about collateral effect however blocking Tracker may cause instability to the following packages:

apt-cache rdepends tracker
tracker
Reverse Depends:
  tracker-extract
  nautilus
  vanilla-gnome-desktop
  rygel-tracker
  netatalk
  kylin-burner
  gnome-photos
  gnome-music
  gnome-games-app
  gnome-documents
  gnome-core
  gnome-boxes
  gnome-books
  brasero
  bijiben
  tracker-miner-fs
  tracker-extract

Probably all the gnome-* packages require tracker to work properly.


Tracker is an Indexer

By default Tracker is handled by .desktop as you can read from the manual:

DESCRIPTION
tracker-miner-fs  is  not  supposed  to  be run by the user since it is started by its .desktop file when the user logs  in.  It  can  also  be started manually of course for debugging purposes. You can not run more than one instance of this at the same time.

and are stored in /etc/xdg/autostart/:

ls -l /etc/xdg/autostart/ | grep tracker
-rw-r--r-- 1 root root  522 Feb 23 12:15 tracker-extract.desktop
-rw-r--r-- 1 root root  535 Feb 23 12:15 tracker-miner-apps.desktop
-rw-r--r-- 1 root root  530 Feb 23 12:15 tracker-miner-fs.desktop
-rw-r--r-- 1 root root  600 Apr 12 11:20 tracker-store.desktop

However in the article it suggested to mask these services but when I looked to find them I didn't find those services:

$ systemctl list-units | grep tracker
$ 

Nothing!

This led me to discuss with the guy behind the article arguing the (s)he was just copying and pasting without testing those commands, actually I was wrong and I'll explain later, hence I just modified those .desktop file directly on my home.

You have to copy those files in ~/.config/autostart/ and change true in false

X-GNOME-Autostart-enabled=false

However this method has a limit, you can't get rid off the component tracker-store which is extremely resilient, I have even modified and removed the tracker-store.desktop on /etc/xdg/autostart/ but it has continued to be active no matter what!

Doing that you have this result:

$ ps ax | grep tracker
10225 ?        Ssl    0:00 /usr/lib/tracker/tracker-store

$ tracker status 
Currently indexed: 0 files, 0 folders
Remaining space on database partition: 364.3 GB (74.90%)
All data miners are idle, indexing complete

What is it this tracker-store?

DESCRIPTION
tracker-store  provides  both  a  powerful database daemon which allows clients to query or update their  data  using  the  highly  descriptive SPARQL language. tracker-store  does  not do any file crawling or any mining of data it‐self, instead other processes do that while tracker-store serves  as  a daemon  waiting for such requests from application miners like tracker-miner-fs.

It seems harmless and it didn't indexing any files however at this point I want completely stop it! Why?

Because it is supposed that you can disable or manage it trough the settings panel:

Gnome SettingsGnome Settings

Or manage it trough dconf-editor: Dconf-EditorDconf-Editor

But unfortunately the system is insensitive to these settings hence you have a lot of cool switches that actually are useless (until someone comes out to notice me that I was wrong, which has its high probability).

Don't put stuff that don't work

About this point we have to come back at the main discourse. Tracker has been dormant for a long time for performance issue. You (probably Ubuntu) woke up it for unclear reason and eventually you can't handle it through GUI because it is simply insensitive to these switches.

Indexing the computer is something addressed to the newbies, just them are interested in those things. I am pretty sure that power users prefer using others solutions especially the ones that do not impact on system performances. I don't want anything indexed for security reason, for privacy and for performance. I prefer keeping my file organized in a rational way that you can easily find what you need and for quick search I use locate | grep something.

Always systemd

Systemd took is revenge against me! I am one that was against systemd since the beginning, I am still against it but this time it made me do an epic fail... 🤦‍♂️

Oh man... 🤦‍♂️

On that article we have this solution:

systemctl --user mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service

I didn't even read carefully: > You can mask the Tracker systemd services to completely disable it for your current user using this command [...]

Now I discovered that you can activate, deactivate and even masked service that aren't activated yet per user!

https://wiki.archlinux.org/index.php/Systemd/User

In fact the firs time I didn't notice:

systemctl --user mask [...]

The --user makes totally the difference. With this command I can masked all the Tracker services per user (without administrative powers) and stop it definitively!

systemctl --user mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service
Unit tracker-miner-rss.service does not exist, proceeding anyway.
Created symlink /home/USER/.config/systemd/user/tracker-store.service → /dev/null.
Created symlink /home/USER/.config/systemd/user/tracker-miner-fs.service → /dev/null.
Created symlink /home/USER/.config/systemd/user/tracker-miner-rss.service → /dev/null.
Created symlink /home/USER/.config/systemd/user/tracker-extract.service → /dev/null.
Created symlink /home/USER/.config/systemd/user/tracker-miner-apps.service → /dev/null.
Created symlink /home/USER/.config/systemd/user/tracker-writeback.service → /dev/null.

This makes me even more frustrated: I have unfairly discussed because my ignorance, and because this is actually pretty cool indeed!

This is the list of the services that you can handle per user:

ls  /usr/lib/systemd/user/
at-spi-dbus-bus.service
basic.target
bluetooth.target
colord-session.service
dbus-org.bluez.obex.service
dbus.service
dbus.socket
default.target
dirmngr.service
dirmngr.socket
evolution-addressbook-factory.service
evolution-calendar-factory.service
evolution-source-registry.service
evolution-user-prompter.service
exit.target
flatpak-portal.service
flatpak-session-helper.service
glib-pacrunner.service
gnome-keyring.service
gnome-keyring-ssh.service
gnome-session.service
gnome-shell.service
gnome-shell-wayland.target
gnome-shell-x11.target
gnome-terminal-server.service
gpg-agent-browser.socket
gpg-agent-extra.socket
gpg-agent.service
gpg-agent.socket
gpg-agent-ssh.socket
graphical-session-pre.target
graphical-session-pre.target.wants
graphical-session.target
gvfs-afc-volume-monitor.service
gvfs-daemon.service
gvfs-goa-volume-monitor.service
gvfs-gphoto2-volume-monitor.service
gvfs-metadata.service
gvfs-mtp-volume-monitor.service
gvfs-udisks2-volume-monitor.service
im-config.service
obex.service
org.gnome.Evince.service
paths.target
printer.target
pulseaudio.service
pulseaudio.socket
session-migration.service
shutdown.target
smartcard.target
sockets.target
sockets.target.wants
sound.target
ssh-agent.service
system76-driver-backlight.service
systemd-exit.service
systemd-tmpfiles-clean.service
systemd-tmpfiles-clean.timer
systemd-tmpfiles-setup.service
timers.target
tracker-extract.service
tracker-miner-apps.service
tracker-miner-fs.service
tracker-store.service
tracker-writeback.service
vino-server.service
xdg-desktop-portal-gtk.service
xdg-desktop-portal.service
xdg-document-portal.service
xdg-permission-store.service

Stop Tracker once and forever

Actually Tracker was been stopped forever with this command already posted:

systemctl --user mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service

Let me show again what happened when I just operated on the .desktop files:

$ ps ax | grep tracker
10225 ?        Ssl    0:00 /usr/lib/tracker/tracker-store
tracker status
Currently indexed: 0 files, 0 folders
Remaining space on database partition: 364.3 GB (74.90%)
All data miners are idle, indexing complete
$ du -h .cache/tracker/
3.9M	.cache/tracker/

Somehow tracker-store is still active. To make my changes active I have to relaunch the session but before I will erase the .desktop files I modified and I will clean up the .cache:

rm  .config/autostart/tracker-* && rm -r  .cache/tracker/

Tracker annihilated

That works actually pretty good indeed, just check by yourself:

$ ps ax | grep tracker
13565 pts/0    S+     0:00 grep --color=auto tracker

$ tracker status
Could not establish a connection to Tracker: Failed to load SPARQL backend: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit tracker-store.service is masked.

$ du -h .cache/tracker/
du: cannot access '.cache/tracker/': No such file or directory 

This got rid also of tracker-store!

🍺

#PostInstallation #PopOS #Gnome3 #LinuxDesktop #OpenSource #Tracker #Linux #System76 #Ubuntu #systemd

if you want comment this article add me on Diaspora, Friendica or Mastodon: gnuserland@social.isurf.ca