SA Bugzilla – Bug 1700
spamd stops logging to syslog after log-cycling
Last modified: 2003-04-21 14:53:05 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
Created attachment 829 [details] patch to fix
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.
OK, this should be fixed in CVS; there's now a SIGHUP handler which re-execs. this will fix log-cycling problems.