Bug 3033 - enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config
Summary: enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and re...
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: unspecified
Hardware: Other other
: P5 enhancement
Target Milestone: 2.70
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
: 4210 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-11 14:21 UTC by Gary Funck
Modified: 2005-03-22 05:40 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Funck 2004-02-11 14:21:27 UTC
For installations that run spamd, it is inconvenient and error-prone to have to 
remember to restart spamd after changes have been made to local.cf and related 
configuration (*.cf) files located in the /etc/mail/spamassassin directory.

Some systems are capable of supporting file alteration alerts, which can be 
used to tell spamassassin when files within the /etc/mail/spamassassin 
directory have been modified.

For example, this CPAN module interfaces to SGI's FAM subsystem (which is 
available for Irix and Linux):
http://search.cpan.org/~jglick/SGI-FAM-1.002/lib/SGI/FAM.pm

(see man fam(3) on most newer Linux systems, and
http://oss.sgi.com/projects/fam/ for details)

As an enhancement, modify spamd to automatically monitor
changes to its config files and config directory, and automatically
reload the configuration files after they have been changed.

(possible problem: if the files are changed via a copy command, it
may take a second/two before the contents of the directory are stable.)
Comment 1 Malte S. Stretz 2004-02-12 01:39:19 UTC
Hm, this would need quite some logic change to make Conf.pm feed back the list 
of currently used config files and directories to spamd which would need to 
incorporate FAM into its event loop. As I'm currently modding on Conf.pm 
anyway, I think I could implement it, but it looks like it would get hairy. 
 
Theoretically it would be a nice feature, but 'kill -HUP' already works for 
spamd and that's the "real" UNIX way of reloading config files; I know that I 
myself sometimes change stuff in the config files and save the file in between 
(just because I am used to save files every few seconds) so if spamd noticed 
that change, it might either find a broken config or reload every few seconds 
(evertime I hit "save") with another config... 
 
I tend to close this as WONTFIX but let's see what the other devs think :) If 
spamd got FAM support, it would be an optional feature which had to be enabled 
in the config file and would default to off. 
Comment 2 Daniel Quinlan 2004-02-12 02:48:49 UTC
I agree with Malte on this one.
Comment 3 Justin Mason 2004-02-12 09:44:55 UTC
Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


- -1 from me.  FAM is not widely available.

I would suggest that we could do something similar by monitoring
modification times on the .cf files and the cf directories, then
statting them periodically (like after each scan).  But I'd
be concerned that would slow things down quite a lot.

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAK7uQQTcbUG5Y7woRAiZDAKDi70R1QRVbIfNrWDSEWVmy8QuU+ACeIb/a
rtfD1zxBxtc2M2ruVxYnlaU=
=1HRW
-----END PGP SIGNATURE-----

Comment 4 Gary Funck 2004-02-12 10:02:24 UTC
Subject: RE:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config


After following the discussion, and thinking this over a bit, I'm going
to -1 my
proposed enhancement. My motivation for having this feature was to lower the
support overhead ("did you restart spamd?") and to help overcome the
time/two
that I'd forgotten to restart spamd, but it looks like this sort of
automation
is difficult to achieve given current constraints.

Perhaps one 'fix' would be to move the things that are often modified the
most
(explicit whitelists/blacklists) into a database and provide tools to update
them.
Arguably some of the more
popular rulesets that are periodically updated (bigevil, and evilnums come
to mind) would be better suited to a database, and a single eval rule for
each that looks up url's and postal addresses in the database.
I don't know if this principal could be extended to the SA ruleset in
general. The closest analog that I know of is sendmail's access.db. I think,
but am not sure, that makemap for example, likely sends a signal to sendmail
telling it that one of the maps has been modified, because it doesn't
require
that the user manually restart sendmail when a new map has been created.



Comment 5 Rich Puhek 2004-02-12 10:06:25 UTC
Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin
 and reload config

bugzilla-daemon@bugzilla.spamassassin.org wrote:
> http://bugzilla.spamassassin.org/show_bug.cgi?id=3033
> 
> gary@intrepid.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Summary|enhancement: modify spamd to|enhancement: modify spamd to
>                    |monitor changes to          |monitor changes to
>                    |/etc/mail/spamassassin and  |/etc/mail/spamassassin and
>                    |relogd config               |reload config

-1 from me too. If I want a program to restart/reload, I'll fire off the 
init.d script or send a HUP. I don't want daemons unexpectedly reading 
configurations.

OTOH, it might be useful if someone were sharing the config files over 
an NFS mount across several machines.

If someone does take the time to implement it, I'd highly recommend that 
it be a configurable option that defaults to disabled.

--Rich

Comment 6 Malte S. Stretz 2004-02-12 10:18:39 UTC
Ok, I think we have found a consensus ;-) 
Comment 7 Justin Mason 2004-02-12 11:09:49 UTC
Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>-1 from me too. If I want a program to restart/reload, I'll fire off the 
>init.d script or send a HUP. I don't want daemons unexpectedly reading 
>configurations.

That's a very good point -- say I'm editing a rules file, accidentally
hit "W", and write a file with a half-written rule -- that would
take effect immediately.  Not a good thing IMO

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAK892QTcbUG5Y7woRAhaqAJ9b7Kj4gOTyAgzLaNviZm5OdxAcpQCcCvNC
kU4N63l01UPbExcGvJSVr9w=
=3RYH
-----END PGP SIGNATURE-----

Comment 8 Kelsey Cummings 2004-02-12 11:15:51 UTC
Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config

On Thu, Feb 12, 2004 at 11:09:50AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> http://bugzilla.spamassassin.org/show_bug.cgi?id=3033
> 
> 
> 
> 
> 
> ------- Additional Comments From jm@jmason.org  2004-02-12 11:09 -------
> Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> >-1 from me too. If I want a program to restart/reload, I'll fire off the 
> >init.d script or send a HUP. I don't want daemons unexpectedly reading 
> >configurations.
> 
> That's a very good point -- say I'm editing a rules file, accidentally
> hit "W", and write a file with a half-written rule -- that would
> take effect immediately.  Not a good thing IMO

Or just the fact that it'd be possible for spamd to get a partial file
while your editor was writting it.  (How many editors do automic file
updates?)  

-1

(Hey, wait, I'm not a Dev.)

<g>

Comment 9 Malte S. Stretz 2004-02-12 11:30:38 UTC
Okokok folks, calm down; more than closing it as WONTFIX I can't do :) 
Comment 10 Duncan Findlay 2004-02-12 11:44:35 UTC
Subject: Re:  enhancement: modify spamd to monitor changes to /etc/mail/spamassassin and reload config

> -1
> 
> (Hey, wait, I'm not a Dev.)

We welcome votes from non devs, but they just hold no numerical
weight. It's good to see a consensus within the community, and your
opinions matter, so feel free to vote.
Comment 11 Malte S. Stretz 2005-03-22 14:40:11 UTC
*** Bug 4210 has been marked as a duplicate of this bug. ***