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.
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
DUMPThe 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:
sudo time updatedb
, listed size of database, set PRUNE_BIND_MOUNTS="no"
, rerun updatedb
with new time report and database size.
Dec 30, 2020 at 23:40
/run
is typically mounted as typetmpfs
, which is one of the defaultPRUNEFS
types in/etc/updatedb.conf