spamc is hanging

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
428
[more info below]

Hi All,

I'm showing these hanging processes when I run ps fax

29371 ? S 0:00 /usr/sbin/exim -Mc 1KgopT-0007bC-9F
29372 ? S 0:00 \_ /usr/sbin/exim -Mc 1KgopT-0007bC-9F
29373 ? S 0:00 \_ /usr/sbin/exim -oMr spam-scanned -bS
29374 ? S 0:00 \_ /usr/sbin/exim -Mc 1KgopT-0007bC-9F
29375 ? S 0:00 \_ /usr/bin/spamc -u middoka1
29376 ? Z 0:00 \_ [exim] <defunct>
29434 ? S 0:00 /usr/sbin/exim -Mc 1KgoqM-0007eS-Ct
29435 ? S 0:00 \_ /usr/sbin/exim -Mc 1KgoqM-0007eS-Ct
29436 ? S 0:00 \_ /usr/sbin/exim -oMr spam-scanned -bS
29437 ? S 0:00 \_ /usr/sbin/exim -Mc 1KgoqM-0007eS-Ct
29438 ? S 0:00 \_ /usr/bin/spamc -u cbluoo1
29439 ? Z 0:00 \_ [exim] <defunct>

I believe this is related to spamc (SpamAssasin), but I'm not sure.
I'm suspecting some config issues, or perhaps a problem with SA internals.

Any pointers on how to analyze this?

-Alon.


[updated info - see more log info and more questions]

Hi All,

I've been experiencing a problem with spamc / spamd processes hanging when I run ps fax.
This is causing the mail delays for those accounts/emails.


I've researched the problem further and examined both /var/log/maillog and /var/log/exim/mainlog for the same time frame and with the same email messages.

First, I've noticed the problem occurs with BSMTP connections.

I've experienced this in several servers. Some servers hang and others are somehow releasing it after a timeout.

See the logs below:


server1.myserver.com:/var/log/exim # grep 1Kh1WB-00046x-QD mainlog
2008-09-20 15:24:56 1Kh1WB-00046x-QD <= [email protected] H=([79.127.4.202]) [79.127.4.202] P=esmtp S=2423 id=000701d72821$0675f820$366530a5@yjsekg T="ID:25989 Make sure all your pharmaceutical needs are taken care of" from <[email protected]> for [email protected]
2008-09-20 15:29:57 1Kh1WB-00046x-QD <[email protected]>: spamcheck transport output: An error was detected while processing a file of BSMTP input.
2008-09-20 15:29:57 1Kh1WB-00046x-QD ** [email protected] <[email protected]> F=<[email protected]> R=spamcheck_director T=spamcheck: Child process of spamcheck transport returned 2 from command: /usr/sbin/exim (preceded by transport filter timeout while writing to pipe)
2008-09-20 15:29:57 1Kh1b3-0004QI-5C <= <> R=1Kh1WB-00046x-QD U=mail P=local S=3793 T="Mail delivery failed: returning message to sender" from <> for [email protected]
2008-09-20 15:29:57 1Kh1WB-00046x-QD Completed


From maillog (I did a grep on somdom1 so you only see the user's lines):


Sep 20 15:24:56 server1 spamd[5234]: spamd: setuid to somdom1 succeeded
Sep 20 15:24:56 server1 spamd[5234]: spamd: processing message <000701d72821$0675f820$366530a5@yjsekg> for somdom1:567
Sep 20 15:25:09 server1 spamd[5234]: bayes: cannot open bayes databases /home/somdom1/.spamassassin/bayes_* R/W: lock failed: File exists
Sep 20 15:25:09 server1 spamd[5234]: spamd: identified spam (17.8/5.0) for somdom1:567 in 13.0 seconds, 2423 bytes.
Sep 20 15:25:09 server1 spamd[5234]: spamd: result: Y 17 - BAYES_99,DATE_IN_FUTURE_96_XX,FH_DATE_PAST_20XX,HTML_MESSAGE,RCVD_IN_PBL,URIBL_AB_SURBL,URIBL_BLACK,
URIBL_JP_SURBL,URIBL_OB_SURBL,URIBL_SBL,URIBL_SC_SURBL scantime=13.0,size=2423,user=somdom1,uid=567,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=35860,mid=<000701d72821$0675f820$366530a5@yjsekg>,bayes=1.000000,autolearn=unavailable
Sep 20 15:25:17 server1 spamd[5234]: bayes: cannot open bayes databases /home/somdom1/.spamassassin/bayes_* R/W: lock failed: File exists



So the question now is: What is the source of the problem of the Error with bayes checks, and how do I go about fixing it?


Thanks for the input.

-Alon.

[updated info - for better or for worst - how I resolved]

cd /home/somdom1/.spamassassin
rm -Rf bayes_*

There were files (which I deleted before I wrote them down) called: bayes_expirey.99898 .
There about 20 files of that kind amounted to 186MB.
Also there was a file called bayes.lock (also deleted).

So hopefully this doesn't break anything and keeps the mail coming in with no more errors.

-Alon.
 
Last edited:
You found the reason for the lock error :). That file was probably all you needed to delete.

It should work now, but you've probably lost all your years of bayes learning.

Jeff
 
From John of DA:


Sep 20 15:25:09 server1 spamd[5234]: bayes: cannot open bayes databases /home/somdom1/.spamassassin/bayes_* R/W: lock failed: File exists

Possibly permissions, try:

cd /usr/local/directadmin/scripts
./set_permissions.sh user_homes
./set_permissions.sh email

Failing that, delete the bayes_* files:

cd /home
rm -f */.spamassassin/bayes_*

and let spamd create them again.


=====================================

It seems that I did find a solution earlier, but thought this might also help someone else.

-Alon.
 
Back
Top