Linux 为什么locate命令找不到任何pid文件

Linux 为什么locate命令找不到任何pid文件,linux,ubuntu,locate,Linux,Ubuntu,Locate,我正在使用ubuntu 12.04 通常我可以使用locate 但是我无法在/var/run 甚至find命令也找不到它们 我已使用sudo updatedb updatedb.conf PRUNE_BIND_MOUNTS="yes" # PRUNENAMES=".git .bzr .hg .svn" PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs" PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_mi

我正在使用ubuntu 12.04

通常我可以使用
locate

但是我无法在
/var/run

甚至find命令也找不到它们

我已使用
sudo updatedb

updatedb.conf

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

您需要查看/bin/updatedb.sh的内容,并检查变量pruefs和pruepaths。默认情况下,/var/run没有在Ubuntu的prunePath变量中指定(我相信),但是tmpfs在PRUNEFS中列出,这就是/var/run的含义。如果您想让它列出该文件夹的内容,您需要从updatedb.sh中的filesystem prune变量(以及cron作业文件)中删除tmpfs。尽管我不太确定您为什么要这样做。。。它不适合搜索频繁变化的系统,find是否更适合您find在这种情况下应该可以工作(假设您已确保具有读取权限)。

因此,首先

`stat -f -c %T /var/run` 
显示此文件夹的文件系统是
tmpfs

然后

显示
updatedb.conf
禁止扫描
tmpfs
文件系统上的文件和文件夹

PRUNEFS=“NFS nfs4 rpc\u pipefs afs binfmt\u misc proc smbfs autofs iso9660 ncpfs尾波devpts ftpfs devfs mfs shfs系统cifs光泽
tmpfs
usbfs udf fuse.glusterfs fuse.sshfs curlftftpfs ecryptfs fusemb devtmpfs“

这就是为什么在/var/run文件中找不到
locate

有用链接:


what
cat/etc/updatedb.conf
outputs?真的属于@skwllsp,并补充说在问题中,我打赌您的FS类型是列出的PRUNEFS类型之一。what
stat-f-c%T/var/run
outputs?
`cat /etc/updatedb.conf`