You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Arthur Dent <mi...@blueyonder.co.uk> on 2008/12/06 10:38:06 UTC

Sa-update exit codes

Hello All,

I have the following command running daily in my crontab on my Fedora 9
box: (excuse the linewrap)

sa-update --channelfile
/etc/mail/spamassassin/sare-sa-update-channels.txt --gpgkey 856AA88A
--gpgkey 6C6191E3 && /sbin/service spamassassin restart

and every day I get a reassuring email in my root system email showing
the following:

Stopping spamd: [  OK  ]
Starting spamd: [  OK  ]

The day before yesterday however the spamd restart messages stopped. I
investigated by running the above command with the -D switch and found -
unsurprisingly that all of the channels gave results like:

[19758] dbg: channel: metadata version = 320722979
[19758] dbg: dns: 5.2.3.sought.rules.yerp.org => 320722979, parsed as
320722979
[19758] dbg: channel: current version is 320722979, new version is
320722979, skipping channel

showing that all the channels were up-to-dateup-to-date.

The last line however was:
[19758] dbg: diag: updates complete, exiting with code 1

Is this an error code?
Does this explain why the "&& /sbin/service spamassassin restart" fails
to run now?

If necessary I can post (or paste to pastebin) the whole debug report...

Thanks in advance for any help or suggestions...

AD


Re: Sa-update exit codes

Posted by mouss <mo...@netoyen.net>.
Arthur Dent a écrit :
> Hello All,
> 
> I have the following command running daily in my crontab on my Fedora 9
> box: (excuse the linewrap)
> 
> sa-update --channelfile
> /etc/mail/spamassassin/sare-sa-update-channels.txt --gpgkey 856AA88A
> --gpgkey 6C6191E3 && /sbin/service spamassassin restart
> 
> and every day I get a reassuring email in my root system email showing
> the following:
> 
> Stopping spamd: [  OK  ]
> Starting spamd: [  OK  ]
> 
> The day before yesterday however the spamd restart messages stopped. I
> investigated by running the above command with the -D switch and found -
> unsurprisingly that all of the channels gave results like:
> 
> [19758] dbg: channel: metadata version = 320722979
> [19758] dbg: dns: 5.2.3.sought.rules.yerp.org => 320722979, parsed as
> 320722979
> [19758] dbg: channel: current version is 320722979, new version is
> 320722979, skipping channel
> 
> showing that all the channels were up-to-dateup-to-date.
> 
> The last line however was:
> [19758] dbg: diag: updates complete, exiting with code 1
> 
> Is this an error code?


I use (after sa-update command):


errorcode=$?

if [ $errorcode = 1 ]; then
    output "No fresh updates available"
    exit 0
fi

if [ $errorcode -gt 1 ]; then
    output "Channel update failed (err=$errorcode)"
    exit 1
fi

output "channels updated"

output "Compiling rules"
(echo -n "########"; date) >  /var/log/sa-compile.out
sa-compile  >>  /var/log/sa-compile.out 2>&1

output "Restarting amavisd"
/usr/local/etc/rc.d/amavisd restart

exit 0


> Does this explain why the "&& /sbin/service spamassassin restart" fails
> to run now?
> 

no. you should be able to restart sa anytime you want!

> Can it be true that there have been NO updates to SA rules, SARE or
> Sought Rules in the last 2 days?...

The only "exception" I see is 90_2tld_cf_sare_sa-update_dostech_net.cf
which was updated on 06-Dec-2008 05:14.

Sought shows a date of: 03-Dec-2008 04:32. This is unusual. maybe it's
related to svn.apache.org certificate renewal?






Re: Sa-update exit codes

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Sat, 2008-12-06 at 10:17 +0000, Arthur Dent wrote:
> On Sat, Dec 06, 2008 at 09:38:06AM +0000, Arthur Dent wrote:
> > Is this an error code?
> > Does this explain why the "&& /sbin/service spamassassin restart" fails
> > to run now?

Yes, it is. Yes, it does.  As documented by 'man sa-update'. And
intended, also as per the logic of your cron job. ;)

> Sigh...
> 
> OK - I've had my morning cup of tea now. I have now actually turned on
> my brain.

Lucky you. Didn't have my coffee yet and barely slept at all. *sigh*

> I realise of course that the question I should have posed is:
> 
> Can it be true that there have been NO updates to SA rules, SARE or
> Sought Rules in the last 2 days?...

Yes, espacially with SARE and the official SA update channel. It's
entirely normal and expected for those to see no update even in weeks.

> Sorry - I'm so used to regular updates from (especially JM Sought) that
> I thought something must be wrong when I saw no restart.

This indeed is unusual for Sought. Noticed this myself already, last
update on Wed. Did happen in the past, though. I wouldn't be alarmed by
it just yet.


> It's Saturday. I think I'll go back to bed...

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: Sa-update exit codes

Posted by Arthur Dent <mi...@blueyonder.co.uk>.
On Sat, Dec 06, 2008 at 09:38:06AM +0000, Arthur Dent wrote:
> Is this an error code?
> Does this explain why the "&& /sbin/service spamassassin restart" fails
> to run now?

Sigh...

OK - I've had my morning cup of tea now. I have now actually turned on
my brain.

I realise of course that the question I should have posed is:

Can it be true that there have been NO updates to SA rules, SARE or
Sought Rules in the last 2 days?...

Sorry - I'm so used to regular updates from (especially JM Sought) that
I thought something must be wrong when I saw no restart.

It's Saturday. I think I'll go back to bed...

AD