[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how to make locate work



How do I make locate work?  I installed slocate, I have this in
/etc/cron.daily:

#! /bin/sh

if [ -x /usr/bin/slocate ]
then
        if [ -f /etc/updatedb.conf ]
        then
                /usr/bin/updatedb
        else
                /usr/bin/updatedb -f proc
        fi
        chown root.slocate /var/lib/slocate/slocate.db
fi

... I have this in /etc/updatedb.conf:

# 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 ncpfs coda
devpts ftpfs"
export PRUNEFS
# paths which are pruned from updatedb database
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool"
export PRUNEPATHS
# netpaths which are added
NETPATHS=""
export NETPATHS

... And my /var/lib/slocate/slocate.db is only 1 byte.  updatedb
runs for about 1 microsecond before exiting without any output.  The
ONLY thing updatedb does is this, after regular libc initialization:

open("/var/lib/slocate/slocate.db.tmp", O_WRONLY|O_CREAT|O_TRUNC,
0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
brk(0x8055000)                          = 0x8055000
lstat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open(".", O_RDONLY)                     = 4
fchdir(4)                               = 0
fchdir(4)                               = 0
close(4)                                = 0
write(3, "1", 1)                        = 1
close(3)                                = 0
munmap(0x40014000, 4096)                = 0
chdir("/etc/cron.daily")                = 0
rename("/var/lib/slocate/slocate.db.tmp",
"/var/lib/slocate/slocate.db") = 0
chmod("/var/lib/slocate/slocate.db", 0640) = 0
chown32(0x804bdc0, 0, 0x67)             = 0
_exit(0)                                = ?

So, I ran 'slocate -u' by hand like the docs say, and it actually
built an index.  Is this simply a case of the cron entry missing the
right program flags, or omitting them for some peculiar reason?

-jwb


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: