Bug 1700 - spamd stops logging to syslog after log-cycling
Summary: spamd stops logging to syslog after log-cycling
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 2.52
Hardware: Other other
: P5 normal
Target Milestone: 2.60
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-28 00:21 UTC by Justin Mason
Modified: 2003-04-21 14:53 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
patch to fix patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Mason 2003-03-28 00:21:12 UTC
On Fri, 28 Mar 2003, Simon Byrnand wrote:

> At 18:04 27/03/03 -0500, ralphg@beol.net wrote:
>
> >Running spamassassin 2.50.  Logging to syslog facility local4.  When I
> >stop and restart my syslog server, spamd no longer logs anything.

> I think you'll find this is a bug in your system syslog or libc libraries,
> not a spamassassin specific bug. I've seen the same problem with another


Hmm, I didnt want to go that route.  None of my other daemons have
ever exhibited this behavior (that I know of).

I think it is very bad that spamd can stop logging like this, so I
fixed it and made the attached patch (applies to spamd/spamd.raw in
2.50 spamassassin).

I'm not sure what Sys::Syslog's openlog() does internally, but it must
not reopen /dev/log unless you have previously called closelog().  So
this patch adds a closelog() at the bottom of sub logmsg.  I am not
sure how much more work the system must now do, but this is very
important to me, to not lose spamd logging.

> The only answer I've found is "don't do that". There should be no reason
> why you have to stop and start syslog when rotating your logs, you should
> just be sending it -SIGHUP.

Well I provide an answer, fix spamd. :-)  On this Debian distrution
box, sysklogd log rotation scripts do a restart instead of a
reload/hup.  I dont know why these scripts do this, but your advice is
good and I changed the scripts to do a hup.

> Regards,
> Simon

+ralph
Comment 1 Justin Mason 2003-03-28 00:21:53 UTC
Created attachment 829 [details]
patch to fix
Comment 2 Antony Mawer 2003-03-28 11:56:55 UTC
Subject: Re: [SAdev]  New: spamd stops logging to syslog after log-cycling 


Actually, another idea would be to institute a "kill -1" handler, which
either

  a) re-exec's the script with all cmdline flags, a full restart, or

  b) just reopens the syslog

(a) would be more intuitive, as it's std unix daemon semantics.

--j.

Comment 3 Justin Mason 2003-04-21 22:53:05 UTC
OK, this should be fixed in CVS; there's now a SIGHUP handler which re-execs. 
this will fix log-cycling problems.