You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by on 2019/09/14 19:30:48 UTC

Spam child

I am still getting spammed processes that last for hours or days. When I kill them, `kill -9` they come back after the load drops. The processes use 100% of the processor.

nobody   72041 100.0  2.2  87264  76940  -  R    10:36      35:28.97 spamd child (perl)
root     52954   0.0  1.9  76992  67124  -  I    13:41       0:01.60 spamd child (perl)
root     55342   0.0  0.2  24904   7828  -  Ss   Sun15       0:06.06 /usr/local/sbin/spamass-milter -f -p /var/run/spamass-milter.sock -u spamd -r 10 -i 65.121.55.40/29 -i 127.0.0.1 -e covisp.net
root     73409   0.0  2.1  84860  75240  -  I    Wed20       0:59.01 spamd child (perl)
root     84607   0.0  1.8  73880  63700  -  Ss   Tue01       0:20.77 /usr/local/bin/perl -T -w /usr/local/bin/spamd -c -H /var/spool/spamd -d -r /var/run/spamd/spamd.pid

The only way to get rid of it is to stop spamd and restart it.

Running SA 3.4.2 on FreeBSD 11.3 with no updates pending. I tried updating perl, but that did not work at all, it appears SA can’t use perl 5.30.

I’ve just setup cron to stop/start sa-spamd periodically until I figure out why this is happening.

What is starting spamd as nobody instead of root like the other processes?






-- 
Do not meddle in the affairs of Dragons for you are crunchy and taste
good with ketchup


Re: Spam child

Posted by "@lbutlr" <kr...@kreme.com>.
On Sep 15, 2019, at 1:09 AM, Axb <ax...@gmail.com> wrote:
> On 9/14/19 9:30 PM, @lbutlr wrote:
>> I am still getting spammed processes that last for hours or days. When I kill them, `kill -9` they come back after the load drops. The processes use 100% of the processor.
>> nobody   72041 100.0  2.2  87264  76940  -  R    10:36      35:28.97 spamd child (perl)
>> root     52954   0.0  1.9  76992  67124  -  I    13:41       0:01.60 spamd child (perl)
>> root     55342   0.0  0.2  24904   7828  -  Ss   Sun15       0:06.06 /usr/local/sbin/spamass-milter -f -p /var/run/spamass-milter.sock -u spamd -r 10 -i 65.121.55.40/29 -i 127.0.0.1 -e covisp.net
>> root     73409   0.0  2.1  84860  75240  -  I    Wed20       0:59.01 spamd child (perl)
>> root     84607   0.0  1.8  73880  63700  -  Ss   Tue01       0:20.77 /usr/local/bin/perl -T -w /usr/local/bin/spamd -c -H /var/spool/spamd -d -r /var/run/spamd/spamd.pid
>> The only way to get rid of it is to stop spamd and restart it.
>> Running SA 3.4.2 on FreeBSD 11.3 with no updates pending. I tried updating perl, but that did not work at all, it appears SA can’t use perl 5.30.
>> I’ve just setup cron to stop/start sa-spamd periodically until I figure out why this is happening.
>> What is starting spamd as nobody instead of root like the other processes?
> 
> 
> Is this what you're looking for?

I don’t think so, the issue is spamd child processes that keep running for days and peg one of the cores.

> https://spamassassin.apache.org/full/3.4.x/doc/spamd.txt
> -m num, --max-children=num        Allow maximum num children
> 
> --min-children=num                Allow minimum num children
> 
> --min-spare=num                   Lower limit for number of spare children
> 
> --max-spare=num                   Upper limit for number of spare children
> 
> --max-conn-per-child=num          Maximum connections accepted by child before it is respawned



-- 
<div id="me"><div id="Dennis Miller>It's just my opinion. I could be
wrong.</div>But I'm not.</div>


Re: Spam child

Posted by Axb <ax...@gmail.com>.
On 9/14/19 9:30 PM, @lbutlr wrote:
> I am still getting spammed processes that last for hours or days. When I kill them, `kill -9` they come back after the load drops. The processes use 100% of the processor.
> 
> nobody   72041 100.0  2.2  87264  76940  -  R    10:36      35:28.97 spamd child (perl)
> root     52954   0.0  1.9  76992  67124  -  I    13:41       0:01.60 spamd child (perl)
> root     55342   0.0  0.2  24904   7828  -  Ss   Sun15       0:06.06 /usr/local/sbin/spamass-milter -f -p /var/run/spamass-milter.sock -u spamd -r 10 -i 65.121.55.40/29 -i 127.0.0.1 -e covisp.net
> root     73409   0.0  2.1  84860  75240  -  I    Wed20       0:59.01 spamd child (perl)
> root     84607   0.0  1.8  73880  63700  -  Ss   Tue01       0:20.77 /usr/local/bin/perl -T -w /usr/local/bin/spamd -c -H /var/spool/spamd -d -r /var/run/spamd/spamd.pid
> 
> The only way to get rid of it is to stop spamd and restart it.
> 
> Running SA 3.4.2 on FreeBSD 11.3 with no updates pending. I tried updating perl, but that did not work at all, it appears SA can’t use perl 5.30.
> 
> I’ve just setup cron to stop/start sa-spamd periodically until I figure out why this is happening.
> 
> What is starting spamd as nobody instead of root like the other processes?


Is this what you're looking for?


https://spamassassin.apache.org/full/3.4.x/doc/spamd.txt
-m num, --max-children=num        Allow maximum num children

--min-children=num                Allow minimum num children

--min-spare=num                   Lower limit for number of spare children

--max-spare=num                   Upper limit for number of spare children

--max-conn-per-child=num          Maximum connections accepted by child 
before it is respawned


Re: Spam child

Posted by "@lbutlr" <kr...@kreme.com>.
On Sep 15, 2019, at 3:03 PM, RW <rw...@googlemail.com> wrote:
> On Sun, 15 Sep 2019 13:36:13 -0600
> @lbutlr wrote:
>> On Sep 15, 2019, at 6:53 AM, RW <rw...@googlemail.com> wrote:
>>> When  child processes are running as root they switch to the unix
>>> user running spamc  (or specified with spamc -u) for processing the
>>> scan. If that would still result in root being used the child
>>> process switches to nobody instead.  
>> 
>> OK, should I set rc.conf to pass -u spamd then?
> 
> Probably, unless you need spamd to use per user files in
> ~/.spamassassin. Running spamc as a single unprivileged user has a
> similar effect, but it's more error prone.

This did not exactly solve the problem, as I still had a stuck process, only it was not using 100% of a core and it wasn’t owned by nobody. This lead me to move aside the existing bases DB files.

File type and version of the DB is the same, but toehold ones were causing an error " cannot open bayes databases /var/spool/spamd/.spamassassin/bayes_* R/W: lock failed: Interrupted system call” which was lost it eh noise of the error about soma child still running.

👹 # file .spamassassin*/bayes_seen                                                               .spamassassin_old/bayes_seen: Berkeley DB 1.85 (Hash, version 2, native byte-order)
.spamassassin/bayes_seen:     Berkeley DB 1.85 (Hash, version 2, native byte-order)
👹 # ls -ls .spamassassin*/bayes_seen
256 -rw-rw-rw-  1 spamd  spamd    131072 Sep 15 15:46 .spamassassin/bayes_seen
31360 -rw-rw-rw-  1 spamd  spamd  20250624 Aug 20 07:28 .spamassassin_old/bayes_seen

Now I just need to feed some spam and ham to the database.



-- 
'I don't see why everyone depends on me. I'm not dependable. Even I
don't depend on me, and I'm me.’


Re: Spam child

Posted by RW <rw...@googlemail.com>.
On Sun, 15 Sep 2019 13:36:13 -0600
@lbutlr wrote:

> On Sep 15, 2019, at 6:53 AM, RW <rw...@googlemail.com> wrote:
> > When  child processes are running as root they switch to the unix
> > user running spamc  (or specified with spamc -u) for processing the
> > scan. If that would still result in root being used the child
> > process switches to nobody instead.  
> 
> OK, should I set rc.conf to pass -u spamd then?


Probably, unless you need spamd to use per user files in
~/.spamassassin. Running spamc as a single unprivileged user has a
similar effect, but it's more error prone.


> And if this is an issue, why is “run as root” marked as “recommended”
> when setting up spamassassin in FreeBSD ports?

The meaning of that is confusing, AS_ROOT actually causes -u to be
added. 

I've a vague recollection that this came up on the ports list and
someone tried to make a case that it was correct. But looking back
through the history, it looks like a "!" fell-off, probably when the
port was switched to the "options framework".

I presume it was originally recommended a long time ago, when it was
more common to use procmail to deliver to home directories.


Re: Spam child

Posted by "@lbutlr" <kr...@kreme.com>.
On Sep 15, 2019, at 6:53 AM, RW <rw...@googlemail.com> wrote:
> When  child processes are running as root they switch to the unix user
> running spamc  (or specified with spamc -u) for processing the scan. If
> that would still result in root being used the child process switches
> to nobody instead.

OK, should I set rc.conf to pass -u spamd then?

And if this is an issue, why is “run as root” marked as “recommended” when setting up spamassassin in FreeBSD ports?


-- 
++?????++ Out of Cheese Error. Redo From Start.


Re: Spam child

Posted by RW <rw...@googlemail.com>.
On Sat, 14 Sep 2019 13:30:48 -0600
@lbutlr wrote:

 
> What is starting spamd as nobody instead of root like the other
> processes?

Most likely it's caused by something running spamc as root or trying to
scan an email for the root user.

When  child processes are running as root they switch to the unix user
running spamc  (or specified with spamc -u) for processing the scan. If
that would still result in root being used the child process switches
to nobody instead.

Re: Spam child

Posted by RW <rw...@googlemail.com>.
On Sat, 14 Sep 2019 13:30:48 -0600
@lbutlr wrote:


> Running SA 3.4.2 on FreeBSD 11.3 with no updates pending. I tried
> updating perl, but that did not work at all, it appears SA can’t use
> perl 5.30.

I'm using perl 5.30 with SA 3.4.2 on FreeBSD 12.0.