PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > Missing files in locatedb
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

Missing files in locatedb

Réponse
 
LinkBack Outils de la discussion
Vieux 27/09/2007, 19h40   #1
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Missing files in locatedb

Hello. Today I found a very strange problem. Some files seem to be
missing from locatedb database.

It all started with one particular file I wanted to find. But 'locate
<word>' didn't find the file I was looking for. I went to the
directory it was supposed to be, and there it was!

I have a cron job to updatedb every night. In fact:

$ ls -l /var/cache/locate/
total 7020
-rw-r--r-- 1 root root 7173582 2007-09-27 06:26 locatedb

So it seems to be in order. The file I wanted was created in August. So?

In fact, none the files in this directory is in the database!

In case you're curious, the directory is named

~/textos/fisica/departamento_fisica/departamento

In /etc/updatedb.conf, there is the following line:

PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool /sfs /media"

So I don't think updatedb should omit this directory. In fact, none of
the files in any subdirectory of ~/textos/fisica/departamento_fisica/
is indexed!

I've made some random search of files in other directories, and they
seem indexed. In fact files in ~/textos itself are indexed.

Some files in the original problematic directory have permissions
-rw------- (does updatedb respect this), but the file I was looking
for in the first place has read permissions for all.

I don't understand. Does any?

Regards,

Victor


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 20h30   #2
Johannes Wiedersich
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Victor Munoz wrote:
> Hello. Today I found a very strange problem. Some files seem to be
> missing from locatedb database.


[snip]

> I don't understand. Does any?


Try running 'updatedb' as root manually and check if this s.

Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG+/USC1NzPRl9qEURAkN3AJ9pDW/DYuwggs803MvgiI9/uDv/wwCfXxEL
1eCAPBxlTPzeZ4WQvEwT2pI=
=RoV2
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 20h50   #3
Ron Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/27/07 12:38, Victor Munoz wrote:
> Hello. Today I found a very strange problem. Some files seem to be
> missing from locatedb database.
>
> It all started with one particular file I wanted to find. But 'locate
> <word>' didn't find the file I was looking for. I went to the
> directory it was supposed to be, and there it was!
>
> I have a cron job to updatedb every night. In fact:
>
> $ ls -l /var/cache/locate/
> total 7020
> -rw-r--r-- 1 root root 7173582 2007-09-27 06:26 locatedb
>
> So it seems to be in order. The file I wanted was created in August. So?
>
> In fact, none the files in this directory is in the database!
>
> In case you're curious, the directory is named
>
> ~/textos/fisica/departamento_fisica/departamento
>
> In /etc/updatedb.conf, there is the following line:
>
> PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool /sfs /media"
>
> So I don't think updatedb should omit this directory. In fact, none of
> the files in any subdirectory of ~/textos/fisica/departamento_fisica/
> is indexed!
>
> I've made some random search of files in other directories, and they
> seem indexed. In fact files in ~/textos itself are indexed.
>
> Some files in the original problematic directory have permissions
> -rw------- (does updatedb respect this), but the file I was looking
> for in the first place has read permissions for all.
>
> I don't understand. Does any?


When were these files created?

- --
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG+/nCS9HxQb37XmcRAqp0AKCjY7VDWXovc/lUiWeiTKFRp2iJvwCePucv
wleP/20aTOv5HzhdVisMDpw=
=TOSw
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 21h30   #4
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 01:43:14PM -0500, Ron Johnson wrote:
> >
> > Some files in the original problematic directory have permissions
> > -rw------- (does updatedb respect this), but the file I was looking
> > for in the first place has read permissions for all.
> >
> > I don't understand. Does any?

>
> When were these files created?
>


There are 7 files with -rw------- permission, last modification times
between 2003-10-16 and 2007-06-11, and 9 files with -rw-r--r--
permissions, last modification times between 2007-05-02 and 2007-08-29.
Anyway, other directories which don't seem to be indexed either have
files with timestamps in various ranges, I don't see any correlation.

Victor


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 21h30   #5
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 03:21:32PM -0400, Victor Munoz wrote:
> On Thu, Sep 27, 2007 at 01:43:14PM -0500, Ron Johnson wrote:
> > >
> > > Some files in the original problematic directory have permissions
> > > -rw------- (does updatedb respect this), but the file I was looking
> > > for in the first place has read permissions for all.
> > >
> > > I don't understand. Does any?

> >
> > When were these files created?
> >

>
> There are 7 files with -rw------- permission, last modification times
> between 2003-10-16 and 2007-06-11, and 9 files with -rw-r--r--
> permissions, last modification times between 2007-05-02 and 2007-08-29.
> Anyway, other directories which don't seem to be indexed either have
> files with timestamps in various ranges, I don't see any correlation.


what are the permissions on the parent directories? that might be more
relevant.

A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG/APzaIeIEqwil4YRAnf7AKDjxUJZax/Dguoofa1iN8wHgHGIhwCgvvjR
+66uJvnTnz1DzjwBRULAAi0=
=eMxl
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 27/09/2007, 21h40   #6
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 12:26:43PM -0700, Andrew Sackville-West wrote:
>
> what are the permissions on the parent directories? that might be more
> relevant.
>


drwxr-xr-x in all cases.

Victor




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 22h00   #7
Mumia W..
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On 09/27/2007 02:21 PM, Victor Munoz wrote:
> On Thu, Sep 27, 2007 at 01:43:14PM -0500, Ron Johnson wrote:
>>> Some files in the original problematic directory have permissions
>>> -rw------- (does updatedb respect this), but the file I was looking
>>> for in the first place has read permissions for all.
>>>
>>> I don't understand. Does any?

>> When were these files created?
>>

>
> There are 7 files with -rw------- permission, last modification times
> between 2003-10-16 and 2007-06-11, and 9 files with -rw-r--r--
> permissions, last modification times between 2007-05-02 and 2007-08-29.
> Anyway, other directories which don't seem to be indexed either have
> files with timestamps in various ranges, I don't see any correlation.
>
> Victor
>
>


Check /etc/updatedb.conf and the LOCALUSER variable. LOCALUSER is set to
'nobody' by default, and 'nobody' has no ability to view directories
with -rwx------ permissions.




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 22h00   #8
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 03:31:23PM -0400, Victor Munoz wrote:
> On Thu, Sep 27, 2007 at 12:26:43PM -0700, Andrew Sackville-West wrote:
> >
> > what are the permissions on the parent directories? that might be more
> > relevant.
> >

>
> drwxr-xr-x in all cases.
>


Wrong. One had permissions drwxr-xr-- as I mention in other post, and
that's why it failed.

Thanks,

Victor


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 22h00   #9
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 08:23:14PM +0200, Johannes Wiedersich wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Victor Munoz wrote:
> > Hello. Today I found a very strange problem. Some files seem to be
> > missing from locatedb database.

>
> [snip]
>
> > I don't understand. Does any?

>
> Try running 'updatedb' as root manually and check if this s.
>


It worked. All missing files are there now.

At first, this was a mystery, but now I understand why. updatedb is
not run as root, but as 'nobody', as set in /etc/updatedb.conf, so
the sequence

$ . /etc/updatedb.conf; updatedb

yields a lot of "Permission denied" messages, unlike "$ updatedb".

And I was wrong when I replied to another post in this thread, saying
that all directories had permissions drwxr-xr-x. ~/textos/fisica had
drwxr-xr--, and that was it.

So it's all working now, and much better, I understand :-) Thanks for
the .

Victor


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 27/09/2007, 22h10   #10
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 03:31:23PM -0400, Victor Munoz wrote:
> On Thu, Sep 27, 2007 at 12:26:43PM -0700, Andrew Sackville-West wrote:
> >
> > what are the permissions on the parent directories? that might be more
> > relevant.
> >

>
> drwxr-xr-x in all cases.
>


are these directories nfs mounts by any chance? that's all I can think
of, as they are excluded by default.

A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG/AypaIeIEqwil4YRAkqDAKDG7Ix3nS4vu6BjLVafjsUN8pnbagC fYw/e
F3did549+7LWjahVGCuQRkk=
=sPRO
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 28/09/2007, 00h40   #11
Victor Munoz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

On Thu, Sep 27, 2007 at 02:53:18PM -0500, Mumia W.. wrote:
>
> Check /etc/updatedb.conf and the LOCALUSER variable. LOCALUSER is set to
> 'nobody' by default, and 'nobody' has no ability to view directories
> with -rwx------ permissions.
>


That was the problem, indeed. Thanks,

Victor


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 28/09/2007, 09h00   #12
Johannes Wiedersich
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Missing files in locatedb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Victor Munoz wrote:
> It worked. All missing files are there now.
>
> At first, this was a mystery, but now I understand why. updatedb is
> not run as root, but as 'nobody', as set in /etc/updatedb.conf, so
> the sequence
>
> $ . /etc/updatedb.conf; updatedb
>
> yields a lot of "Permission denied" messages, unlike "$ updatedb".
>
> And I was wrong when I replied to another post in this thread, saying
> that all directories had permissions drwxr-xr-x. ~/textos/fisica had
> drwxr-xr--, and that was it.
>
> So it's all working now, and much better, I understand :-) Thanks for
> the .


I use package 'slocate' instead of 'locate':

/-----------
$ aptitude show slocate
Package: slocate
[snip]
Description: Secure replacement of findutil's locate
This locate can index all files on your system, but only files and
directories which the invoking user has access
to will be displayed.

Note: If your computer is not up 24/7 you should consider installing
anacron since the database is only updated
once a night.
\-----------

Usage is like for locate, ie. I type locate, but it will execute slocate.

HTH,

Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG/KQjC1NzPRl9qEURAmNNAJ994vsY6IKqt5BFQtHVjs0Mp4+gUAC fTCEk
BWaMziTDCLv4q9cxMNuP4Us=
=9tLN
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h34.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18747 seconds with 20 queries