Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75909 - SLOCATE doesn't properly identify NFS mounts when softlinked
Summary: SLOCATE doesn't properly identify NFS mounts when softlinked
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-28 06:23 UTC by Eric Jones
Modified: 2006-10-05 17:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jones 2004-12-28 06:23:23 UTC
The daily cron script installed by the slocate package doesn't parse the /etc/updatedb.conf file by default so it tries to index all NFS mounts each morning.  I'm not sure if this is the cause behind it locking up but I've seen this application hung on several Gentoo machines now in the last month or so, holding up the cron process.

Reproducible: Always
Steps to Reproduce:
1. emerge slocate
2. run cron daemon
3. see that the updatedb program indexes NFS filesystems which is not what the settings in updatedb.conf file are set for by default.

Actual Results:  
'locate' returned files that are found on NFS mounted filesystems.

Expected Results:  
listed only locally available files.
Comment 1 SpanKY gentoo-dev 2004-12-28 08:48:54 UTC
emerge info ?
slocate version ?
/etc/update.conf ?
output of `mount` and /proc/mounts ?
does it happen if you run` updatedb` yourself ?
Comment 2 Eric Jones 2004-12-28 09:05:00 UTC
root:~> emerge -pv slocate

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-apps/slocate-2.7-r5  -debug (-uclibc) 110 kB

Total size of downloads: 110 kB

contents of /etc/updatedb.conf:

  # Copyright 1999-2004 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  # $Header: /var/cvsroot/gentoo-x86/sys-apps/slocate/files/updatedb.conf,v 1.13 2004/10/04 04:33:31 vapier Exp $

  # This file sets environment variables which are used by updatedb

  # filesystems which are pruned from updatedb database
  PRUNEFS="NFS nfs afs proc smbfs autofs auto iso9660 devfs tmpfs ramfs ncpfs sysfs supermount devpts usbfs cifs nnpfs subfs udf"
  export PRUNEFS
  # paths which are pruned from updatedb database
  PRUNEPATHS="/tmp /var/tmp"
  export PRUNEPATHS
  # netpaths which are added
  NETPATHS=""
  export NETPATHS

end of /etc/updatedb.conf

output of mount:

  /dev/sda3 on / type ext2 (rw,noatime)
  none on /proc type proc (rw)
  none on /sys type sysfs (rw)
  none on /dev type devfs (rw)
  none on /dev/pts type devpts (rw)
  none on /dev/shm type tmpfs (rw)
  none on /proc/bus/usb type usbfs (rw)
  boss:/qa on /qa type nfs (rw,nosuid,nodev,soft,intr,rsize=8192,wsize=8192,addr=192.168.100.1)
  boss:/qb on /qb type nfs (rw,nosuid,nodev,soft,intr,rsize=8192,wsize=8192,addr=192.168.100.1)
  boss:/sqa on /sqa type nfs (rw,nosuid,nodev,soft,intr,rsize=8192,wsize=8192,addr=192.168.100.1)
  boss:/wrk/rama on /wrk/rama type nfs (rw,nosuid,nodev,soft,intr,rsize=8192,wsize=8192,addr=192.168.100.1)
  192.168.100.181:/pub on /pub type nfs (rw,nosuid,nodev,soft,intr,rsize=8192,wsize=8192,addr=192.168.100.181,addr=192.168.100.181)
  /dev/sda1 on /boot type ext2 (rw,noatime)
  192.168.100.181:/pub/Software/distfiles on /usr/portage/distfiles type nfs (rw,addr=192.168.100.181,addr=192.168.100.181)

end of mount

output of `cat /proc/mounts`:

  rootfs / rootfs rw 0 0
  /dev/root / ext2 rw,noatime 0 0
  none /proc proc rw,nodiratime 0 0
  none /sys sysfs rw 0 0
  none /dev devfs rw 0 0
  none /dev/pts devpts rw 0 0
  none /dev/shm tmpfs rw 0 0
  none /proc/bus/usb usbfs rw 0 0
  boss:/qa /mnt/qa nfs rw,nosuid,nodev,v2,rsize=8192,wsize=8192,soft,intr,udp,lock,addr=boss 0 0
  boss:/qb /mnt/qb nfs rw,nosuid,nodev,v2,rsize=8192,wsize=8192,soft,intr,udp,lock,addr=boss 0 0
  boss:/sqa /mnt/sqa nfs rw,nosuid,nodev,v2,rsize=8192,wsize=8192,soft,intr,udp,lock,addr=boss 0 0
  boss:/wrk/rama /wrk/rama nfs rw,nosuid,nodev,v2,rsize=8192,wsize=8192,soft,intr,udp,lock,addr=boss 0 0
  192.168.100.181:/pub /mnt/pub nfs rw,nosuid,nodev,v2,rsize=8192,wsize=8192,soft,intr,udp,lock,addr=192.168.100.181 0 0
  /dev/sda1 /boot ext2 rw,noatime 0 0
  192.168.100.181:/pub/Software/distfiles /usr/portage/distfiles nfs rw,v2,rsize=8192,wsize=8192,hard,udp,lock,addr=192.168.100.181 0 0

end of output

/mnt/qb, /mnt/qa, and /mnt/pub are all mounted as NFS and should be pruned from the database update but they are not.  This COULD be caused by softlinks to the root directory, i.e., /qa -> /mnt/qa.  I can't verify this at this moment because I have users running programs that rely on those softlinks to be there.  If /mnt/ is added to the PRUNEPATHS variable then it seems to solve the problem.  Ideas?  (in other words, it looks like it isn't caused by the /etc/updatedb.conf file but by slocate's ability to determine filesystems).
Comment 3 SpanKY gentoo-dev 2004-12-28 13:04:25 UTC
if you add '/qa' to PRUNEPATHS, does everything work ok ?

you could also check out `updatedb -v`
Comment 4 Eric Jones 2004-12-28 13:15:45 UTC
That does not solve the problem.  The issue is that either the documentation or the program is faulty since NFS filesystems shouldn't be getting indexed.

with PRUNEPATHS="/mnt/qa" the problem is solved
with PRUNEPATHS="/qa" the problem is NOT solved

But the expected result is that /qa is not indexed even with PRUNEPATHS="" since it should be caught by the PRUNEFS declaration.
Comment 5 SpanKY gentoo-dev 2005-05-03 18:20:35 UTC
not fixed yet ...
Comment 6 Johannes Niess 2005-08-15 12:28:38 UTC
For me slocate seems to ignore the configuration file 
completely. /mnt/data/backup/snapshots/ is my base directory for rsnapshot. It 
contains about 10 (mostly hardlinked) file system backups. I tested by 
searching the log file a for pruned path. 
 
slocate cron job FAILS 
slocate -u -v -c >/tmp/slocate-files FAILS 
(source /etc/updatedb.conf; slocate -u -v -c  >/tmp/slocate-files) FAILS 
slocate -u -v -c -e /mnt/data/backup/snapshots/ >/tmp/slocate-files PASSES 
 
bash-2.05b$ cat /etc/updatedb.conf 
# Copyright 1999-2004 Gentoo Foundation 
# Distributed under the terms of the GNU General Public License v2 
# $Header: /var/cvsroot/gentoo-x86/sys-apps/slocate/files/updatedb.conf,v 1.13 
2004/10/04 04:33:31 vapier Exp $ 
 
# This file sets environment variables which are used by updatedb 
 
# filesystems which are pruned from updatedb database 
PRUNEFS="NFS nfs afs proc smbfs autofs auto iso9660 devfs tmpfs ramfs ncpfs 
sysfs supermount devpts usbfs cifs nnpfs subfs udf" 
export PRUNEFS 
# paths which are pruned from updatedb database 
#PRUNEPATHS="/tmp /var/tmp" 
PRUNEPATHS="/tmp /var/tmp  /mnt/data/backup/snapshots/" 
export PRUNEPATHS 
# netpaths which are added 
NETPATHS="" 
export NETPATHS 
bash-2.05b$ 
 
stingray slocate # emerge -s slocate 
Searching... 
[ Results for search key : slocate ] 
[ Applications found : 1 ] 
 
*  sys-apps/slocate 
      Latest version available: 2.7-r7 
      Latest version installed: 2.7-r5 
      Size of downloaded files: 95 kB 
      Homepage:    http://www.geekreview.org/slocate/ 
      Description: Secure way to index and quickly search for files on your 
system (drop-in replacement for 'locate') 
      License:     GPL-2 
 
The problem is not mentioned in r6 or r7 changelogs.  
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-10-05 17:25:04 UTC
please re-test with ~arch and reopen if needed.