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.
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.
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.
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...
This could be considered a mere configuration problem. Does anyone encounter this problem even with a sane cron setup?
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.
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?
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.