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.

4
  • 2
    The /run directory may be excluded from indexing. If so you can remove from excluded list. Dec 30, 2020 at 16:13
  • 2
    +1 indeed, /run is typically mounted as type tmpfs, which is one of the default PRUNEFS types in /etc/updatedb.conf Dec 30, 2020 at 16:20
  • @WinEunuuchs2Unix would you like to roll that up into an answer? Dec 30, 2020 at 16:22
  • @steeldriver I'm on my phone for five more hours before I can answer. Go ahead and answer if you like. Thanks. Dec 30, 2020 at 18:20

1 Answer 1

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:

1
  • 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. Dec 30, 2020 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .