Hello happy SpamAssassin users,

Every night, I stop Postfix, stop SA, force-expire bayes db,
restart SA, restart Postfix. This goes fine most of the time, but
sometimes I run into problems.

The problems arise around once a week or so : spamc cannot connect
to spamd, saying the following in the maillog file :

Dec 15 04:25:15 server spamc[18803]: connect(AF_INET) to spamd
at 127.0.0.1 failed, retrying (#1 of 3): Connection refused

When this happens, manually restarting spamd resolves the problem.
Until next time.

As there is no apparent reason for spamd to die (or not to restart
correctly) in the maillog file, I now start spamd without using '-d',
in order to log stderr and stdout messages in a separate file. I am
now using the following command to start spamd :

/usr/bin/spamd -c -u spam >/var/log/test_spamd.
`/bin/date +%Y%m%d%H%M`.log 2>&1 &

The problem occured again, and I catched the following from spamd output
:
test_spamd.200501090003 :
Could not create INET socket on 127.0.0.1:783: Address already in use
(IO::Socket::INET: Address already in use)

As if spamd was still started. But the maillog file of the same night
says :
Jan  9 00:00:31 server spamd[31849]: server killed by SIGTERM, shutting
down
Jan  9 00:03:39 server spamd[22233]: spamd starting

Maybe spamd (or one of its children) is not correctly or not fully
terminated, and still listening to port 783, even 3 minutes after
saying "shutting down" ?


Are some of you experiencing the same problems ?
Thanks to anyone with any clue on this problem.


Some more info :
I am using Postfix 1.1.12, SA 3.0.1, MIME-Base64-3.05,
DB_File-1.809, and db4-4.0.14-20 (RedHat 9) on a Postfix+SA relay.
The bayes database is common to all users.

I am using the following logrotate script to save the bayes db and
to stop/start SA and Postfix :

# cat /etc/logrotate.d/bayes
/home/spam/.spamassassin/bayes_seen /home/spam/.spamassassin/bayes_toks
/home/spam/.spamassassin/auto-whitelist {
    rotate 15
    sharedscripts
    missingok
    nocreate
    notifempty
    copy
    compress
    prerotate
    /etc/init.d/postfix stop
    sleep 30
    /etc/init.d/spamassassin stop
    su spam -s /bin/sh -c "sa-learn --force-expire"
    endscript
    postrotate
    /etc/init.d/spamassassin start
    sleep 30
    /etc/init.d/postfix start
    endscript
}


Reply via email to