From: Rahul on
J G Miller <miller(a)yoyo.ORG> wrote in news:i2pgbu$e31$6(a)news.eternal-
september.org:

Thanks again for the tips!

> The file is binary but its format is custom to mlocate so
> there are no tools other than locate for looking at its content.
>
> Use the search facility :/\/home\/ to see if there are
> any entries for your NFS mounted file system.

The pattern for /home is not found. On the other hand /etc /var etc. do
result in matches within this binary file.

> If there are no entries present then updatedb has not
> examined the contents of the file system, which may be
> due to user mapping/permission problems.

Not sure which permission is the issue. /home has the following
permissions:

drwxr-xr-x 24 root root 4096 Jul 27 15:51 home

So they are pretty open. What user does updatedb run as? The only thing
that makes /home different than the other dirs is the fact that it resides
on a remote server (NFS). Has to be a mapping issue. But can't find what is
telling updatedb to avoid NFS systems.


--
Rahul
From: Chris Davies on
Rahul <nospam(a)nospam.invalid> wrote:
> PRUNEFS = "auto afs gfs gfs2 iso9660 sfs udf"
> PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups
> /var/spool/squid /var/tmp"

Is the filesystem containing your home directory NFS mounted as a symbolic
link from something under /net (or one of the other directories listed
in PRUNEPATHS)?

Chris
From: J G Miller on
On Friday, July 30th, 2010 at 02:04:09h +0000, Rahul wrote:

> What user does updatedb run as?

You need to start from the top.

Which script is being run to update the locate database?

How is this script being run and by whom?
From: Joe Beanfish on
On 07/27/10 19:47, Rahul wrote:
> Our /home dir is mounted via NFS from another server. Whenever I try to run
> "locate" to search for a file it doesn't find it. Of course, if I login to
> the server where the data physically resides then locate does find the
> date.
>
> How can I get locate on the machine to also find the data that resides on
> the other machine? Either I've to get locate to connect to the database of
> the other machine or I can somehow ask updatedb on the local machine to
> also index the remote NFS files. Not sure which is the better approach and
> how to do this.
>
> I tried digging around in the manpages but can't figure out how locate
> decides what is it's default database. $LOCATE_PATH seems empty.
>
> I do see that in my cron.daily there's a script:
>
> cat mlocate.cron
> #!/bin/sh
> nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }')
> renice +19 -p $$>/dev/null 2>&1
> /usr/bin/updatedb -f "$nodevs"
>
> But even here I'm not sure where it is storing the default database.
>
> Any tips?
>

# grep nfs /proc/filesystems
nodev nfs
nodev nfs4
nodev nfsd

So the above will exclude all nfs filesystems.

You could remove the -f "$nodevs" part so it only uses the settings
in your .conf file.

Note that this may slam the NFS server and/or use a lot of your net
bandwidth.

If your mounted system are the same architecture and version as
the host it looks like you could write a shell script wrapper that
would run locate with the option(s) to use the database on the mounted
system. Run once normally for local files. Run once for each mounted
filesystem telling it to use the mounted database.
From: David W. Hodgins on
On Thu, 29 Jul 2010 22:04:09 -0400, Rahul <nospam(a)nospam.invalid> wrote:

> So they are pretty open. What user does updatedb run as? The only thing

On my Mandriva 2010.1 system, /etc/cron.daily/mlocate.cron is
run as root, and updates /var/lib/mlocate/mlocate.db.

I have an encrypted filesystem, that I have explicitly excluded
in /etc/updatedb.conf.

The encrypted filesystem is mounted by a script run from my
~/.profile. After it's mounted, I manually run
/usr/bin/updatedb -U /var/mnt/data -l 0 -o /var/mnt/data/mlocate/mlocate.db --prunepaths="" --prunefs=""
and have included in .profile
export LOCATE_PATH="/var/mnt/data/mlocate/mlocate.db"

If I run a locate command as root, it doesn't see the files in
the encrypted filesystem. If I run it under my userid, it does.

I would try a similar approach, where the system that physically
has the filesystem runs an updatedb for just that filesystem,
creating an mlocate.db on that filesystem.

Then have users that remotely mount the filesytem set their
LOCATE_PATH, to include that remotely mounted mlocate.db.

Regards, Dave Hodgins


--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)