Tyler Nally wrote: > On Tuesday 28 February 2006 05:06 pm, Jonathan Nie wrote: >> Greetings! >> >> I got a problem when I try to feed Bayes with large number of emails >> (over 1500). It just hang there and I got the the following error >> messages from maillog file: >> >> .....bayes: cannot open bayes databases /spamassassin/bayes_* R/W: lock >> failed: File exists >> >> Does anyone know how to fix it? > > The "bayes" section of my spamassassin setup in local.cf looks like > this: > > #-------------------------------------- > bayes_path /etc/mail/spamassassin/bayes/bayes > bayes_file_mode 0777
<snip> > > Which for me.. would mean that I'd cd to: > > /etc/mail/spamassassin/bayes > > .. and do a (as root): > > chmod 666 bayes* > > ... to allow anyprocess with access to those > bayes files an opportunity to either open and > read/write to it. > OUCH! Bad advice. DO NOT DO THIS!!!! Note that SA is not complaining it cannot access the files. It is complaining that the bayes database is already locked. This means that SA believes another process is ACTIVELY writing to the bayes database. If you wind up doing a chmod 666 on your bayes lock file (which the above command WILL do), and then invoke sa-learn while another process is accessing the database, you will corrupt your ENTIRE bayes database beyond recovery.