You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Ernie Dunbar <ma...@lightspeed.ca> on 2004/10/06 22:09:34 UTC

Odd syslog errors.

I'm running spamassassin 3.0.0 on FreeBSD 4.9-STABLE with the spamd daemon
accepting connections locally from qmail-scanner for all incoming mail.
Our server does some 80K messages per day.

Spamd runs like this:

/usr/local/bin/spamd -A 127.0.0.1 -L -x -u spamc -d -m 10

Every hour or so, it spews forth a dozen or so messages like this:

Oct  5 13:26:25 pop spamd[267]: server hit by SIGCHLD
Oct  5 13:26:25 pop spamd[267]: handled cleanup of child pid 9980
Oct  5 13:26:25 pop spamd[267]: server successfully spawned child process,
pid 19660
Oct  5 13:26:30 pop spamd[267]: server hit by SIGCHLD
Oct  5 13:26:30 pop spamd[267]: handled cleanup of child pid 10643 Oct  5
13:26:30 pop spamd[267]: server successfully spawned child process, pid
19800
Oct  5 13:26:37 pop spamd[267]: server hit by SIGCHLD
Oct  5 13:26:37 pop spamd[267]: handled cleanup of child pid 11051 Oct  5
13:26:37 pop spamd[267]: server successfully spawned child process, pid
19949
Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied Oct 
5 13:26:39 pop spamd[19800]: Cannot open bayes databases
/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied Oct 
5 13:26:41 pop spamd[19949]: Cannot open bayes databases
/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied

And then it's quiet. Mail is still getting scanned and passes through
without any problems but these messages are bugging me.




Re: Odd syslog errors.

Posted by Ernie Dunbar <ma...@lightspeed.ca>.
> Ernie Dunbar wrote:
>>>>Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
>>>>/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied
>>>> Oct
>>>
>>>The typical cause of this is that the file ownership changed on the
>>>bayes files when you converted them to 3.0.  At least this was the
>>> problem
>>>I encountered.
>>>
>>>When I did all my conversions following the UPGRADE procedure as root, I
>>>had to go back in and convert the files back to their correct
>>> ownerships.
>>>Check for that.
>>
>>
>> That's kind of the odd thing. I set the ownership back to spamc, but it
>> was changed to root for bayes_journal and bayes_toks shortly therafter.
>>
>> What I did instead of UPGRADEing, was nuke the whole database and
>> rebuild
>> it from scratch using some new spam.
>>
>
> This can happen if you have any scripts or process that you use to train
> the bayes database. Awhile ago I ran into this issue a few times when I
> was logged in as root and manually trained a message (cat msg | sa-learn
> --spam), which would occasionally change the ownership of the
> journal/etc to root. Fixed that by not doing it as root, though now I
> have bayes in SQL so it doesn't matter.
>

About the only processes I can find that might be doing this are the spamc
children. For some odd reason they run as root, despite that I use the '-u
spamc' switch with spamd. The parent runs as spamc though, which is pretty
confusing. Is this the way it's supposed to run? Or did I mess up the
compile?


Re: Odd syslog errors.

Posted by Ryan Moore <ry...@perigee.net>.
Keith Hackworth wrote:
> Even though you run this in mysql now, it still DOES matter who you run it
> as.  I found out the hard way that it records the user that is logged in
> as the user the bayes applies as in the database.  I had to actually set
> the bayes_sql_override_username in my local.cf.  I trained a bunch of
> messages as root and my spamassassin (through amavis-new) runs as amavis. 
> It didn't see any of the bayes training I did!
> 
> Keith
> 

Yea, I use that same parameter so it doesn't matter for my installation. 
  With the SQL option and that parameter, it doesn't matter now, but 
previously even with using the bayes_path parameter in the older 2.6x SA 
it did matter as permissions got munged sometimes.


Ryan Moore
----------
Perigee.net Corporation
704-849-8355 (sales)
704-849-8017 (tech)
www.perigee.net




Re: Odd syslog errors.

Posted by Keith Hackworth <ke...@rpemail.com>.
Even though you run this in mysql now, it still DOES matter who you run it
as.  I found out the hard way that it records the user that is logged in
as the user the bayes applies as in the database.  I had to actually set
the bayes_sql_override_username in my local.cf.  I trained a bunch of
messages as root and my spamassassin (through amavis-new) runs as amavis. 
It didn't see any of the bayes training I did!

Keith


> Ernie Dunbar wrote:
>>>>Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
>>>>/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied
>>>> Oct
>>>
>>>The typical cause of this is that the file ownership changed on the
>>>bayes files when you converted them to 3.0.  At least this was the
>>> problem
>>>I encountered.
>>>
>>>When I did all my conversions following the UPGRADE procedure as root, I
>>>had to go back in and convert the files back to their correct
>>> ownerships.
>>>Check for that.
>>
>>
>> That's kind of the odd thing. I set the ownership back to spamc, but it
>> was changed to root for bayes_journal and bayes_toks shortly therafter.
>>
>> What I did instead of UPGRADEing, was nuke the whole database and
>> rebuild
>> it from scratch using some new spam.
>>
>
> This can happen if you have any scripts or process that you use to train
> the bayes database. Awhile ago I ran into this issue a few times when I
> was logged in as root and manually trained a message (cat msg | sa-learn
> --spam), which would occasionally change the ownership of the
> journal/etc to root. Fixed that by not doing it as root, though now I
> have bayes in SQL so it doesn't matter.
>
> Ryan Moore
> ----------
> Perigee.net Corporation
> 704-849-8355 (sales)
> 704-849-8017 (tech)
> www.perigee.net
>
>
>



Re: Odd syslog errors.

Posted by Ryan Moore <ry...@perigee.net>.
Ernie Dunbar wrote:
>>>Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
>>>/home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied Oct
>>
>>The typical cause of this is that the file ownership changed on the
>>bayes files when you converted them to 3.0.  At least this was the problem
>>I encountered.
>>
>>When I did all my conversions following the UPGRADE procedure as root, I
>>had to go back in and convert the files back to their correct ownerships.
>>Check for that.
> 
> 
> That's kind of the odd thing. I set the ownership back to spamc, but it
> was changed to root for bayes_journal and bayes_toks shortly therafter.
> 
> What I did instead of UPGRADEing, was nuke the whole database and rebuild
> it from scratch using some new spam.
> 

This can happen if you have any scripts or process that you use to train 
the bayes database. Awhile ago I ran into this issue a few times when I 
was logged in as root and manually trained a message (cat msg | sa-learn 
--spam), which would occasionally change the ownership of the 
journal/etc to root. Fixed that by not doing it as root, though now I 
have bayes in SQL so it doesn't matter.

Ryan Moore
----------
Perigee.net Corporation
704-849-8355 (sales)
704-849-8017 (tech)
www.perigee.net



Re: Odd syslog errors.

Posted by Ernie Dunbar <ma...@lightspeed.ca>.
> On Wed, 6 Oct 2004, Ernie Dunbar wrote:
>
>> Every hour or so, it spews forth a dozen or so messages like this:
>>
>> Oct  5 13:26:25 pop spamd[267]: server hit by SIGCHLD
>> Oct  5 13:26:25 pop spamd[267]: handled cleanup of child pid 9980
>> Oct  5 13:26:25 pop spamd[267]: server successfully spawned child
>> process, pid 19660
>
> These are normal restarts of the spamd child processes.  They happen by
> default after each one handles 200 mails.  Those of us who've been seeing
> memory spikes get these more often because we set --max-conn-per-child to
> a lower number.

Okay, so they're safe to filter out of logcheck. Thanks. :)

>> Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
>> /home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied Oct
>
> The typical cause of this is that the file ownership changed on the
> bayes files when you converted them to 3.0.  At least this was the problem
> I encountered.
>
> When I did all my conversions following the UPGRADE procedure as root, I
> had to go back in and convert the files back to their correct ownerships.
> Check for that.

That's kind of the odd thing. I set the ownership back to spamc, but it
was changed to root for bayes_journal and bayes_toks shortly therafter.

What I did instead of UPGRADEing, was nuke the whole database and rebuild
it from scratch using some new spam.


Re: Odd syslog errors.

Posted by Morris Jones <mo...@whiteoaks.com>.
On Wed, 6 Oct 2004, Ernie Dunbar wrote:

> Every hour or so, it spews forth a dozen or so messages like this:
> 
> Oct  5 13:26:25 pop spamd[267]: server hit by SIGCHLD
> Oct  5 13:26:25 pop spamd[267]: handled cleanup of child pid 9980
> Oct  5 13:26:25 pop spamd[267]: server successfully spawned child process, pid 19660

These are normal restarts of the spamd child processes.  They happen by
default after each one handles 200 mails.  Those of us who've been seeing
memory spikes get these more often because we set --max-conn-per-child to
a lower number.

> Oct  5 13:26:39 pop spamd[19660]: Cannot open bayes databases
> /home/spamc/.spamassassin/bayes_* R/O: tie failed: Permission denied Oct 

The typical cause of this is that the file ownership changed on the
bayes files when you converted them to 3.0.  At least this was the problem
I encountered.  

When I did all my conversions following the UPGRADE procedure as root, I
had to go back in and convert the files back to their correct ownerships.
Check for that.

Best regards,
Mojo
-- 
Morris Jones         <*>
Monrovia, CA
mojo@whiteoaks.com
http://www.whiteoaks.com