Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151856 - sys-apps/rlocate - rlocate.db.stf exists & is not a valid slocate database
Summary: sys-apps/rlocate - rlocate.db.stf exists & is not a valid slocate database
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 180557
  Show dependency tree
 
Reported: 2006-10-18 10:56 UTC by Vladimir G. Ivanovic
Modified: 2007-10-06 13:41 UTC (History)
2 users (show)

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 Vladimir G. Ivanovic 2006-10-18 10:56:21 UTC
I am plagued by messages like:

  updatedb: fatal error: The temp file '/var/lib/rlocate/rlocate.db.stf' already 
  exists and does not appear to be a valid slocate database. Please remove
  before creating the database.

when /etc/cron.daily/rlocate runs. So, I added:

*** /etc/cron.daily/rlocate.~1~ Wed Sep 27 08:12:30 2006
--- /etc/cron.daily/rlocate     Wed Oct 18 10:50:18 2006
***************
*** 1,5 ****
--- 1,10 ----
  #! /bin/sh
  
+ if [ -z /var/lib/rlocate/rlocate.db.stf ]
+ then
+       rm /var/lib/rlocate/rlocate.db.stf
+ fi
+ 
  if [ -x /usr/bin/updatedb ]
  then
        if [ -f /etc/updatedb.conf ]

This patch likely masks a deeper problem.
Comment 1 Heiko Baums 2007-02-19 12:08:52 UTC
I possibly found another reason for this error message. While searching the web I found this link: http://archive.lug.boulder.co.us/Week-of-Mon-20061225/033673.html

This is what someone has written in this thread:
"Someone did suggest checking for 2 cron entries that might overlap and 
run at the same time. Barring that, I wonder if perhaps a software crash 
or a shutdown in the middle of an update could have left the 
intermediate file. Check the timestap on the .stf file, which I believe 
is intermediate and removed once update is done. Does it look like 
perhaps it was left a while back (about the time the problem first 
appeared), and not updated since the problem started? If so, I'd just 
delete that file (the updatedb command can easily recreate the db itself 
from nothing...all newly installed systems must do this), and run 
updatedb again. If that doesn't work, I'd even remove the 
/var/lib/slocate/slocate.db file, and then update."

I'm running fcron and found out that there was an rlocate script in /etc/cron.daily and a line "%daily * * /usr/bin/updatedb" in my fcrontab.

Now I removed this line from fcrontab. I of course have to test it a while to see if the problem is solved now.
Comment 2 Heiko Baums 2007-03-04 05:25:47 UTC
I've tested my solution for a while now and it still works.

Vladimir, if you still have this problem without your patch then you should check if updatedb is finished when it's run by your cron daemon.

/var/lib/rlocate/rlocate.db.stf is only a temp file which is created by updatedb and automatically deleted by updatedb when it has finished correctly. So if this file is still there after an updatedb this shows that updatedb doesn't finish correctly. One possible reason is that cron tries to run it twice at the same time.

So Vladimir's patch is a workaround but doesn't fix the problem.
Comment 3 Rudi Lippert 2007-06-01 17:58:52 UTC
I reported this at SourceForge, although I cannot reproduce it.

http://sourceforge.net/tracker/index.php?func=detail&aid=1729600&group_id=129555&atid=715563
We'll see what they say...
Comment 4 Rudi Lippert 2007-06-04 09:58:15 UTC
This could be considered a mere configuration problem. Does anyone encounter this problem even with a sane cron setup?
Comment 5 Heiko Baums 2007-06-04 11:50:26 UTC
Yes, I did encounter it once or twice after I cleaned my cron setup. But it's not regularly and not that often than it was before. I think I shut down my computer during a running updatedb so that it couldn't finish correctly and delete the temp file.

Maybe there could be really a bug in rlocate that it doesn't delete the temp file when it gets a kill signal. But I'm not sure.
Comment 6 Rudi Lippert 2007-06-05 14:29:23 UTC
I submitted this information and a few suggestions to the SF report. Maybe the author is so kind as to fix it in 0.5.6.
Can we just mark this as "LATER", since it is not really critical?
Comment 7 Heiko Baums 2007-06-05 15:33:16 UTC
I think this should be ok. Or maybe as "UPSTREAM" since you've already reported it upstream if this doesn't conflict with the blocker.