1

Topic: Cron error mail of sa-update

==== Provide required information to help troubleshoot and get quick answer ====
- iRedMail version: 0.7.4
- Linux/BSD distribution name and version: CENTOS 6.2
- Any related log? Log is helpful for troubleshooting.
====

I got a mail daily from cron job with subject "Cron <root@mail> /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log"

The mail content is "Waiting for the process [12392] to terminate", the proccess no. inside [ ] is different daily.

Anyone can help?

Ho

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Cron error mail of sa-update

Looks fine.

Any error message in /var/log/sa-update.log? and what's the content in /usr/share/spamassassin/sa-update.cron?

3

Re: Cron error mail of sa-update

ZhangHuangbin wrote:

Looks fine.

Any error message in /var/log/sa-update.log? and what's the content in /usr/share/spamassassin/sa-update.cron?

[root@mail ~]# cat /var/log/sa-update.log
Waiting for the process [9233] to terminate
Waiting for the process [10860] to terminate
Waiting for the process [12392] to terminate
Waiting for the process [14409] to terminate
Waiting for the process [16356] to terminate

[root@mail ~]# cat /usr/share/spamassassin/sa-update.cron
#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
#
# /etc/mail/spamassassin/channel.d/*.conf
#     Place files here to add custom channels.
#

# Proceed with sa-update if spam daemon is running or forced in /etc/sysconfig/sa-update
unset SAUPDATE
[ -f /etc/sysconfig/sa-update ] && . /etc/sysconfig/sa-update
for daemon in spamd amavisd; do
    /sbin/pidof $daemon >& /dev/null
    [ $? -eq 0 ] && SAUPDATE=yes
done
[ -f /var/run/mimedefang.pid ] && SAUPDATE=yes

# Skip sa-update if daemon not detected
[ -z "$SAUPDATE" ] && exit 0

# sa-update must create keyring
if [ ! -d /etc/mail/spamassassin/sa-update-keys ]; then
    sa-update
fi

# Initialize Channels and Keys
CHANNELLIST=""
KEYLIST=""
# Process each channel defined in /etc/mail/spamassassin/channel.d/
for file in /etc/mail/spamassassin/channel.d/*.conf; do
    [ ! -f "$file" ] && continue
    # Validate config file
    PREFIXES="CHANNELURL KEYID BEGIN"
    for prefix in $PREFIXES; do
        if ! grep -q "$prefix" $file; then
            echo "ERROR: $file missing $prefix"
            exit 255
        fi
    done
    . "$file"
    #echo "CHANNELURL=$CHANNELURL"
    #echo "KEYID=$KEYID"
    CHANNELLIST="$CHANNELLIST $CHANNELURL"
    KEYLIST="$KEYLIST $KEYID"
    sa-update --import "$file"
done

# Sleep random amount of time before proceeding to avoid overwhelming the servers
sleep $(expr $RANDOM % 7200)

unset arglist
# Run sa-update on each channel, restart spam daemon if success
for channel in $CHANNELLIST; do
    arglist="$arglist --channel $channel"
done
for keyid in $KEYLIST; do
    arglist="$arglist --gpgkey $keyid"
done
/usr/bin/sa-update $arglist
if [ $? -eq 0 ]; then
    /sbin/service spamassassin condrestart > /dev/null
    [ -f /etc/init.d/amavisd ] && /sbin/service amavisd condrestart > /dev/null
    [ -f /var/run/mimedefang.pid ] && /sbin/service mimedefang reload > /dev/null
fi

4

Re: Cron error mail of sa-update

It should be fine. Looks like just a little delay.

5

Re: Cron error mail of sa-update

I got this mail everyday, is that normal?

How to know this sa-update job completion everyday ?