1

The command sudo find / -name "php7.2-fpm.sock" returns /run/php/php7.2-fpm.sock but sudo locate php7.2-fpm.sock is empty.

PS: used sudo updatedb before.

1 Answers1

1

Answered by @WinEunuuchs2Unix (concept) and @steeldriver (technical details).

  • Concept: locate can exclude directory from its indexing process.

  • Detail: there are a "locate configuration file", /etc/updatedb.conf (man page) and you can declare many exclusion rules — excluded paths, files or directories will be not scanned by updatedb. Each rule is declared by a variable:

    • PRUNE_BIND_MOUNTS: use "YES" to exclude mounted direcories — so bind mounts are not scanned.
    • PRUNENAMES: list of excluded directory names.
    • PRUNEPATHS: list of excluded path names of directories.
    • PRUNEFS: used when PRUNE_BIND_MOUNTS is flagged ("0" or "NO"), it is a list of file system types, like old /etc/mtab system types to be excluded.

/etc/updatedb.conf DUMP

The problem described in the question occurred in the context of:

PRUNE_BIND_MOUNTS="yes"
# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs devtmpfs fuse.mfs shfs sysfs cifs lustre tmpfs usbfs udf fus
e.glusterfs fuse.sshfs curlftpfs ceph fuse.ceph fuse.rozofs ecryptfs fusesmb"

So, PRUNE_BIND_MOUNTS="yes" excluded /run from updatedb indexation.


Similar questions:

  • Thanks for answering for me. Now I can go do some Python coding :). The only thing different I would have done in my answer is run sudo time updatedb, listed size of database, set PRUNE_BIND_MOUNTS="no", rerun updatedb with new time report and database size. – WinEunuuchs2Unix Dec 30 '20 at 23:40