- sa-update runs in cron automatically if spamd or amavisd is running If

you use neither, you may force sa-update by editing
    /etc/sysconfig/sa-update.
This commit is contained in:
Warren Togami 2009-12-28 06:42:03 +00:00
parent 6dbe413318
commit 1fbc04e571
4 changed files with 34 additions and 8 deletions

View File

@ -1,11 +1,23 @@
#!/bin/bash
# *** DO NOT MODIFY THIS FILE ***
# Edit /etc/cron.d/sa-update to enable nightly automatic updates
#
# /etc/mail/spamassassin/sa-update-channels.txt
# Specify custom channels here
#
# /etc/mail/spamassassin/sa-update-keys.txt
# Specify trusted GPG keys for custom channels here
# 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
# Skip sa-update if daemon not detected
[ -z "$SAUPDATE" ] && exit 0
# Sleep random amount of time before proceeding to avoid overwhelming the servers
sleep $(expr $RANDOM % 7200)

View File

@ -1,9 +1,12 @@
### OPTIONAL: Spamassassin Rules Updates ###
# *** DO NOT MODIFY THIS FILE ***
### Spamassassin Rules Updates ###
#
# http://wiki.apache.org/spamassassin/RuleUpdates
# Highly recommended that you read the documentation before using this.
# ENABLE UPDATES AT YOUR OWN RISK.
#
# sa-update automatically updates your rules once per day if a spam daemon like
# spamd or amavisd are running. You can force sa-update to run in
# /etc/sysconfig/sa-update
#
# /var/log/sa-update.log contains a history log of sa-update runs
#10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log
10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log

View File

@ -0,0 +1,4 @@
# Uncomment below to force nightly sa-update
# (you don't need to do this if you use spamd or amavisd)
#SAUPDATE=yes

View File

@ -1,7 +1,7 @@
# OVERRIDE RHEL VERSION HERE, RHEL BUILDSYSTEM DOESN'T HAVE DIST TAG
#%%define rhel 4
#%define _source_filedigest_algorithm md5
%define _source_filedigest_algorithm md5
# Define Variables that must exist
%{?!rhel:%define rhel 0}
@ -55,7 +55,7 @@ Name: spamassassin
Version: 3.3.0
%define prename rc1
%define proposed .proposed2
Release: 0.26.%{prename}%{?dist}
Release: 0.27.%{prename}%{?dist}
License: ASL 2.0
Group: Applications/Internet
URL: http://spamassassin.apache.org/
@ -68,6 +68,7 @@ Source5: spamassassin.sysconfig
Source6: sa-update.logrotate
Source7: sa-update.crontab
Source8: sa-update.cronscript
Source9: sa-update.force-sysconfig
Source10: spamassassin-helper.sh
Source11: sa-update-channels.txt
Source12: sa-update-keys.txt
@ -174,6 +175,7 @@ install -m 0644 %{SOURCE4} %buildroot/etc/mail/spamassassin
install -m 0755 %{SOURCE10} %buildroot/etc/mail/spamassassin
install -m 0644 %{SOURCE6} %buildroot/etc/logrotate.d/sa-update
install -m 0644 %{SOURCE7} %buildroot/etc/cron.d/sa-update
install -m 0644 %{SOURCE9} %buildroot%{_sysconfdir}/sysconfig/sa-update
# installed mode 744 as non root users can't run it, but can read it.
install -m 0744 %{SOURCE8} %buildroot%{_datadir}/spamassassin/sa-update.cron
install -m 0644 %{SOURCE13} %buildroot%{_datadir}/spamassassin/
@ -217,7 +219,8 @@ echo 783 > $RPM_BUILD_ROOT%{_sysconfdir}/portreserve/spamd
%{_initrddir}/spamassassin
%config(noreplace) %{_sysconfdir}/mail/spamassassin
%config(noreplace) %{_sysconfdir}/sysconfig/spamassassin
%config(noreplace) %{_sysconfdir}/cron.d/sa-update
%config(noreplace) %{_sysconfdir}/sysconfig/sa-update
%{_sysconfdir}/cron.d/sa-update
%dir %{_datadir}/spamassassin
%dir %{_localstatedir}/run/spamassassin
%dir %{_localstatedir}/lib/spamassassin
@ -261,6 +264,10 @@ fi
exit 0
%changelog
* Mon Dec 28 2009 Warren Togami <wtogami@redhat.com> - 3.3.0-0.27.rc1
- sa-update runs in cron automatically if spamd or amavisd is running
If you use neither, you may force sa-update by editing /etc/sysconfig/sa-update.
* Mon Dec 21 2009 Warren Togami <wtogami@redhat.com> - 3.3.0-0.26.rc1
- 3.3.0-rc1.proposed2 with fixed spamc