Matt Sergeant wrote:
On 3-Dec-07, at 2:45 PM, Niklas Therning wrote:

I'm writing a qpsmtpd plugin for our custom spam filter. The plugin reads a couple of custom configuration files at startup. The config files may change at any time and I would like my plugin to pick up those changes automatically.

Now, I've tried to periodically check the timestamp of the files in my plugin and reload them if necessary but never got that to work. I've posted on this list before about that problem but got no replies (http://www.nntp.perl.org/group/perl.qpsmtpd/2007/11/msg7501.html). Now I'm trying to come up with an alternative solution.

Is there any way I could tell a running qpsmtpd-forkserver instance (version 0.32) to reload its plugins without having to restart the process? I guess it would work to restart it entirely but it seems to me that it would be better to just have it reload the plugins so that any running connections don't have to be killed.

I'd be happy to upgrade to a newer qpsmtpd version if that is required or use a different daemon instead of forkserver if that would solve my problem.

Under forkserver, config information should be loaded by each child anyway.

Or do you mean reloading the entire plugin? That's another matter... And something I'm working on as a background task.
Thanks for answering!

I read the config files in my plugin's init(). Do you mean that
forkserver creates a new plugin instance (new $self) and calls init()
each time it forks? I would like to avoid a situation where the config
files are read for every new connection.

I think I mean reloading the entire plugin. I Googled and found some
references to qpsmtpd-highperf which seems to be able to do what I'm
looking for (see
http://www.nntp.perl.org/group/perl.qpsmtpd/2006/05/msg5130.html).
Judging from that conversation this patch has been applied and renamed
qpstmpd-prefork. I had a look at the qpsmtpd-prefork script and it seems
to be able to reload the plugins if I send SIGHUP to it. Can anyone
confirm that this works as expected? Will this create a new plugin
instance and will init() be called on it?

Regards,
Niklas Therning
www.spamdrain.net


Reply via email to