Discussion:
locate.updatedb not working
Matt Garman
2003-06-24 15:02:40 UTC
Permalink
I did a vanilla OpenBSD 3.3 install a couple weeks ago. The
configuration is mostly default. I definately haven't (knowingly)
messed with anything that should affect locate.

I tried to do a "locate somefile" and got:

database too small: /var/db/locate.database

So I did a bit of investigation, and found that the locate database
should be updated weekly (from /etc/weekly). However, when I run that,
I get the following:


Rebuilding locate database:
Not installing locate database; zero size

And when I run plain 'ol "locate.updatedb" with no args, I get the
following output:

awk: weird printf conversion %
input record number 50, file
source line number 1
awk: not enough args in printf(/%)
input record number 50, file
source line number 1

And when I run "locate.updatedb --fcodes=-" I get the same output as
listed above (no files listed).

Has anyone else seen this problem? Anyone have any idea where the fault
may be?

Thanks,
Matt
--
Matt Garman, ***@raw-sewage.net
``I ain't never seen no whiskey, the blues made my sloppy drunk!''
-- Sleepy John Estes, ``Leaving Trunk''
Michael Shalayeff
2003-06-24 15:10:32 UTC
Permalink
Post by Matt Garman
I did a vanilla OpenBSD 3.3 install a couple weeks ago. The
configuration is mostly default. I definately haven't (knowingly)
messed with anything that should affect locate.
database too small: /var/db/locate.database
most likely your /tmp is too small.

cu
--
paranoic mickey (my employers have changed but, the name has remained)
Matt Garman
2003-06-24 15:33:51 UTC
Permalink
Post by Michael Shalayeff
Post by Matt Garman
I did a vanilla OpenBSD 3.3 install a couple weeks ago. The
configuration is mostly default. I definately haven't (knowingly)
messed with anything that should affect locate.
database too small: /var/db/locate.database
most likely your /tmp is too small.
I don't think that's the problem (unless I did something wrong, which is
entirely possible):

# locate.updatedb --fcodes=- --tmpdir=/tmp
awk: weird printf conversion %
input record number 52, file
source line number 1
awk: not enough args in printf(/%)
input record number 52, file
source line number 1

(no other output)

# df -h /tmp
Filesystem Size Used Avail Capacity Mounted on
/dev/sd0e 1.9G 1.0K 1.8G 0% /tmp

Any other thoughts?

Thanks again!
Matt
--
Matt Garman, ***@raw-sewage.net
``I ain't never seen no whiskey, the blues made my sloppy drunk!''
-- Sleepy John Estes, ``Leaving Trunk''
Andreas Kähäri
2003-06-24 15:50:53 UTC
Permalink
Post by Matt Garman
Post by Michael Shalayeff
Post by Matt Garman
I did a vanilla OpenBSD 3.3 install a couple weeks ago. The
configuration is mostly default. I definately haven't (knowingly)
messed with anything that should affect locate.
database too small: /var/db/locate.database
most likely your /tmp is too small.
I don't think that's the problem (unless I did something wrong, which is
# locate.updatedb --fcodes=- --tmpdir=/tmp
awk: weird printf conversion %
input record number 52, file
source line number 1
awk: not enough args in printf(/%)
input record number 52, file
source line number 1
The awk code snippets in /usr/libexec/locate.mklocatedb and
in /usr/libexec/locate.concatdb are, as far as I can tell,
seriously buggy (!!). The 'printf' should really be just
'print'. The bug shows when the awk code is given something
containing a '%' character:

$ echo "won't w%ork" | awk '{ printf $2 }'
awk: not enough args in printf(w%ork)
input record number 1, file
source line number 1

$ echo "will w%ork" | awk '{ print $2 }'
w%ork

The printf function wants a format specifier, just like in C.

Cheers,
Andreas
--
Andreas Kähäri
Essex, England
Matt Garman
2003-06-24 16:10:07 UTC
Permalink
Post by Andreas Kähäri
The awk code snippets in /usr/libexec/locate.mklocatedb and
in /usr/libexec/locate.concatdb are, as far as I can tell,
seriously buggy (!!). The 'printf' should really be just
'print'. The bug shows when the awk code is given something
$ echo "won't w%ork" | awk '{ printf $2 }'
awk: not enough args in printf(w%ork)
input record number 1, file
source line number 1
$ echo "will w%ork" | awk '{ print $2 }'
w%ork
The printf function wants a format specifier, just like in C.
That makes sense---I expected something like that, but I didn't know
where to look.

For what it's worth, I added another partition to the "prunepaths"
argument (i.e. omit this partition), and the command completed. So I
did a manual find on that omitted partition, and, sure enough, I had a
bunch of files with percent signs in the filename.

Thanks for all the help!

Matt
--
Matt Garman, ***@raw-sewage.net
``I ain't never seen no whiskey, the blues made my sloppy drunk!''
-- Sleepy John Estes, ``Leaving Trunk''
Peter Verhagen
2003-06-24 16:13:17 UTC
Permalink
If this is a new install, and if you don't leave your OpenBSD box on
on the weekends (overnight) you likely haven't initialized it yet
(the locate/whereis databases are run from cron in /etc/weekly).

just do a

sh /etc/weekly

to get info into the locate/whereis database.

Peter V
Post by Matt Garman
I did a vanilla OpenBSD 3.3 install a couple weeks ago. The
configuration is mostly default. I definately haven't (knowingly)
messed with anything that should affect locate.
database too small: /var/db/locate.database
So I did a bit of investigation, and found that the locate database
should be updated weekly (from /etc/weekly). However, when I run that,
Not installing locate database; zero size
And when I run plain 'ol "locate.updatedb" with no args, I get the
awk: weird printf conversion %
input record number 50, file
source line number 1
awk: not enough args in printf(/%)
input record number 50, file
source line number 1
And when I run "locate.updatedb --fcodes=-" I get the same output as
listed above (no files listed).
Has anyone else seen this problem? Anyone have any idea where the fault
may be?
Thanks,
Matt
--
``I ain't never seen no whiskey, the blues made my sloppy drunk!''
-- Sleepy John Estes, ``Leaving Trunk''
Continue reading on narkive:
Loading...