为什么 tracker-miner-fs 占用了我 100% 的 CPU?/usr/lib/tracker/tracker-miner-fs 是什么?

为什么 tracker-miner-fs 占用了我 100% 的 CPU?/usr/lib/tracker/tracker-miner-fs 是什么?

什么是 /usr/lib/tracker/tracker-miner-fs?

man tracker-miner-fs

tracker-miner-fs - Used to crawl the file system to mine data.

有人有它送回母舰的链接吗?

我已关闭所有 ubuntu 桌面搜索

设置 -> 搜索 -> 关闭

那为什么它还在运行?

为什么这些系统启动的高资源占用者会在启动时主动出击?至少他们应该知道在启动后潜伏几分钟,然后再重创系统

这是我的顶部

 top

top - 12:18:44 up 2 days, 22:05,  1 user,  load average: 1.78, 0.93, 0.81
Tasks: 402 total,   2 running, 397 sleeping,   0 stopped,   3 zombie
%Cpu(s):  3.1 us,  0.8 sy, 12.3 ni, 81.4 id,  0.0 wa,  0.0 hi,  2.3 si,  0.0 st
MiB Mem :  11890.6 total,   2620.7 free,   6532.1 used,   2737.9 buff/cache
MiB Swap:    980.0 total,    520.4 free,    459.6 used.   4676.9 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                      
 2465 pie       39  19  907480 181896   5516 R 100.7   1.5   0:41.54 tracker-miner-f                                                                                              
27322 pie       20   0 2815908 300964 152648 S  16.3   2.5   0:05.06 Web Content                                                                                                  
26063 pie       20   0 3446052 442824 213372 S  11.6   3.6   1:29.63 firefox-bin                                                                                                  
 2260 pie       20   0 3986768 495212  66044 S   1.7   4.1 180:56.22 gnome-shell                                                                                                  
 2591 pie       20   0 4982644 576408  60328 S   0.7   4.7  98:44.12 skypeforlinux                                                                                                
15989 pie       20   0  847760 255684  79192 S   0.7   2.1  76:30.11 opera-developer                                                                                              
   10 root      20   0       0      0      0 I   0.3   0.0   3:16.04 rcu_sched                                                                                                    
  896 root     -51   0       0      0      0 S   0.3   0.0   4:12.46 irq/129-iwlwifi                                                                                              
 1156 systemd+  20   0   23168   2976   1992 S   0.3   0.0   0:23.42 systemd-resolve                                                                                              
 7691 pie       20   0 1857912 890064 102592 S   0.3   7.3  76:55.09 brave                                                                                                        
15919 pie       20   0  609008  63460  40212 S   0.3   0.5   1:11.66 opera-developer                                                                                              
22668 pie       20   0  797876 206564  95392 S   0.3   1.7   1:01.99 brave                                                                                                        
    1 root      20   0  166808   6648   3776 S   0.0   0.1   0:42.56 systemd                            

这是 pid

ps -eafww|grep 2465 
pie       2465  2131  0 Sep07 tty2     00:00:53 /usr/lib/tracker/tracker-miner-fs

这是它的 ubuntu 包

apt-file search tracker-miner-fs

tracker-miner-fs

这是包装描述

apt show  -a   tracker-miner-fs


Description: metadata database, indexer and search tool - filesystem indexer
 This package contains the tracker indexer for indexing your files and folders.
 .
 Tracker is an advanced framework for first class objects with associated
 metadata and tags. It provides a one stop solution for all metadata, tags,
 shared object databases, search tools and indexing.

为什么这个系统进程占用了我的 100% 的 CPU?

如何清除它......不是通常的方法,因为它似乎嵌入很深,并且进行简单的包清除会破坏我的盒子

 sudo apt purge  tracker-miner-fs 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apturl apturl-common libcue2 libgnome-autoar-0-0 libgsf-1-114 libgsf-1-common libtagc0 libtracker-control-2.0-0 libtracker-miner-2.0-0 nautilus-data tracker tracker-extract
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  gnome-shell-extension-desktop-icons* nautilus* nautilus-share* tracker-miner-fs* ubuntu-desktop* ubuntu-desktop-minimal*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 2,704 kB disk space will be freed.
Do you want to continue? [Y/n] 

所以让我们不要清除它...只需删除它如何

sudo apt remove tracker-miner-fs 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apturl apturl-common libcue2 libgnome-autoar-0-0 libgsf-1-114 libgsf-1-common libtagc0 libtracker-control-2.0-0 libtracker-miner-2.0-0 nautilus-data tracker tracker-extract
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  gnome-shell-extension-desktop-icons nautilus nautilus-share tracker-miner-fs ubuntu-desktop ubuntu-desktop-minimal
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 2,704 kB disk space will be freed.
Do you want to continue? [Y/n]

因此删除它也会破坏机器(如果你删除了一个软件包,而这个软件包又想要删除软件包 ubuntu-desktop,你的机器将无法正常启动,因此需要启动到恢复模式才能启动并运行)

以下是其 ubuntu 包的内容

dpkg -L tracker-miner-fs 
/.
/etc
/etc/xdg
/etc/xdg/autostart
/etc/xdg/autostart/tracker-miner-apps.desktop
/etc/xdg/autostart/tracker-miner-fs.desktop
/usr
/usr/lib
/usr/lib/sysctl.d
/usr/lib/sysctl.d/30-tracker.conf
/usr/lib/systemd
/usr/lib/systemd/user
/usr/lib/systemd/user/tracker-miner-apps.service
/usr/lib/systemd/user/tracker-miner-fs.service
/usr/lib/tracker
/usr/lib/tracker/tracker-miner-apps
/usr/lib/tracker/tracker-miner-fs
/usr/share
/usr/share/dbus-1
/usr/share/dbus-1/services
/usr/share/dbus-1/services/org.freedesktop.Tracker1.Miner.Applications.service
/usr/share/dbus-1/services/org.freedesktop.Tracker1.Miner.Files.service
/usr/share/doc
/usr/share/doc/tracker-miner-fs
/usr/share/doc/tracker-miner-fs/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/tracker-miner-fs
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/tracker-miner-fs.1.gz
/usr/share/tracker
/usr/share/tracker/miners
/usr/share/doc/tracker-miner-fs/changelog.Debian.gz
/usr/share/tracker/miners/org.freedesktop.Tracker1.Miner.Applications.service
/usr/share/tracker/miners/org.freedesktop.Tracker1.Miner.Files.service

我是否应该通过关闭其 systemd 服务来禁用它? 还是让它不管?

uname -m && uname -r && cat /etc/*release
x86_64
5.0.0-28-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu 19.04"
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"

我看到它已通过 dconf-editor ->org->freedesktop->tracker->miner->files 启用

我看到它已通过 dconf-editor ->org->freedesktop->tracker->miner->files 启用

尚未解答的是,谁会从此运行中受益?如果此工具正在执行此操作,我是否还可以订阅发送到母舰的供稿,以便查看谁在使用我的软件包/应用程序?这里的大局是什么?

答案1

有人有它送回母舰的链接吗?

GNOME 追踪器是一款桌面搜索应用程序。它不会将任何内容发送回“母舰”,事实上它完全离线工作。

听起来您想彻底禁用 GNOME Tracker 而不卸载它。以下是如何以自动化方式执行此操作。

  1. 终止所有当前进程。

    killall tracker
    
  2. 停止 systemd 服务。

    systemctl --user stop tracker-{miner-apps,miner-fs,store}
    systemctl --user mask tracker-{miner-apps,miner-fs,store}
    systemctl --user stop tracker-{miner-fs,miner-rss,writeback,xdg-portal,miner-fs-control}-3.service
    systemctl --user mask tracker-{miner-fs,miner-rss,writeback,xdg-portal,miner-fs-control}-3.service
    
  3. 通过 GNOME 关闭 tracker-miner-fs gsettings

    gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2
    gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false
    

    这是文档crawling-interval

    检查数据库中的文件系统是否是最新的时间间隔(以天为单位)。0 表示随时强制抓取,-1 表示仅在非正常关机后强制抓取,-2 表示完全禁用抓取。

  4. 防止追踪器自动启动。

    Hidden=true在所有这些桌面文件中设置:

    • /etc/xdg/autostart/tracker-extract.desktop
    • /etc/xdg/autostart/tracker-miner-apps.desktop
    • /etc/xdg/autostart/tracker-miner-fs.desktop
    • /etc/xdg/autostart/tracker-miner-user-guides.desktop
    • /etc/xdg/autostart/tracker-store.desktop

    以下是我编写的脚本:

    for f in /etc/xdg/autostart/tracker-extract.desktop \
        /etc/xdg/autostart/tracker-miner-apps.desktop \
        /etc/xdg/autostart/tracker-miner-fs.desktop \
        /etc/xdg/autostart/tracker-miner-user-guides.desktop \
        /etc/xdg/autostart/tracker-store.desktop
    do
        if grep '^Hidden=true$' "$f" > /dev/null
        then
            : # do nothing
        elif grep '^Hidden=' "$f" > /dev/null
        then
            sudo sed -i -e 's;Hidden=.*;Hidden=true;' "$f"
        else
            printf "\nHidden=true\n" | sudo tee --append "$f"
        fi
    done
    

    如果您没有 root 权限或者不想更改系统级文件,请改用以下文件:

    • ~/.config/autostart/tracker-extract.desktop
    • ~/.config/autostart/tracker-miner-apps.desktop
    • ~/.config/autostart/tracker-miner-fs.desktop
    • ~/.config/autostart/tracker-miner-user-guides.desktop
    • ~/.config/autostart/tracker-store.desktop

    仅包含这些内容的文件就可以达到目的:

    [Desktop Entry]
    Hidden=true
    
  5. 删除跟踪器数据库。

    tracker reset --hard
    tracker3 reset -s -r
    

    这实际上不是必需的,但可以释放一些硬盘空间。

有关的:

答案2

就我的情况来说,我有时只需这么做,tracker reset --soft就能持续很多天。

(我还没有发现什么行为会导致追踪器失控。)

相关内容