Verdächtiger Befehl „find /“ verwendet ~90 % der Festplatten-E/A

Verdächtiger Befehl „find /“ verwendet ~90 % der Festplatten-E/A

Als ich feststellte, dass mein Server sehr langsam ist, führte ich einige Recherchen durch und stellte mithilfe iotopeines seltsamen Suchbefehls fest, dass 80–96 % der Datenträger-E/A-Auslastung genutzt wird.

  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                                                                                                                  
 4992 idle nobody      7.82 M/s    0.00 B/s  0.00 % 89.69 % find / ...

der ganze Befehl ist sehr groß, ps aux | grep findgibt mir

root      4978  0.0  0.0  49340  2860 ?        SN   06:25   0:00 su nobody -s /bin/sh -c /usr/bin/find / -ignore_readdir_race      \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o      -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
nobody    4991  0.0  0.0   4500   684 ?        SNs  06:25   0:00 sh -c /usr/bin/find / -ignore_readdir_race      \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o      -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
nobody    4992  9.6  0.1  81004 63996 ?        DN   06:25  18:22 /usr/bin/find / -ignore_readdir_race ( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex \(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\) ) -prune -o -print0

für mich sieht es sehr verdächtig aus, selbst wenn ich die Prozesse beende und nachschaue, iotopstartet ein zweiter Befehl

 4933 idle root       85.14 M/s  409.77 M/s  0.00 % 75.22 % sort -z

weiß jemand, was das ist?

PS: Das System ist Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-210-generic x86_64)

Antwort1

Dies entspricht demupdatedb.findutils(1)Befehl im Paket vorhanden locate.

Das /etc/cron.daily/locateSkript wird aus dem täglichen System aufgerufencrontab(normalerweise um 06:25 Uhr, wie in zu sehen /etc/crontab) hat verschiedeneOptionen zum Überspringen einiger Pfade und Dateisysteme:

# Global options for invocations of find(1)
FINDOPTIONS='-ignore_readdir_race'
# filesystems which are pruned from updatedb database
PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf ocfs2"
# paths which are pruned from updatedb database
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool /sfs /media /var/lib/schroot/mount"
# netpaths which are added
NETPATHS=""
# run find as this user
LOCALUSER="nobody"

finddie in Optionen umgewandelt werden inupdatedb.findutilsBefehl.

Alle diese stimmen mit dem Inhalt des OP- ps auxBefehls überein und beginnen mit -ignore_readdir_race.

verwandte Informationen