Emmanuel Dreyfus wrote:
> Oliver Fromme wrote:
> > However, it seems like the xxfi_abort callback is called
> > when the milter is about to terminate. Is that correct?
> > Can't it be used for dumping the DB?
>
> Is it called? That'seasy to check, can you give it a try?
According to the source (signal.c and engine.c), that call-
back is called upon SIGINT, but not on SIGTERM or SIGHUP.
I don't understand why. Additionally, the callback is only
called during a mail transaction. So it probably cannot be
used for reliably dumping the DB. :-(
> > After all, the dumping upon SIGTERM _is_ working fine on
> > FreeBSD 6, so there must already be a way to do it.
>
> I use an atexit() hook. It works on some systems, but not all.
> Feedbacks have been mixed.
>
> > I just wonder why it doesn't work on some other operating
> > systems ... What's the problem with those OS? Do they
> > have a buggy POSIX threads implementation that doesn't
> > handle signals correctly?
>
> The question is: is the atexit hooks called when the process is killed
> by a signal? I'm not sure POSIX says anything about it.
Let me quote:
"The atexit() function shall register the function [...] to
be called [...] at normal program termination. At normal
program termination, all functions registered by the atexit()
function shall be called [...]. Normal termination occurs
either by a call to exit() or a return from main()."
Since libmilter catches the signal and performs a controlled
shutdown, the process is terminated normally by return from
main(). Therefore the atexit() function should be executed.
In fact, it should be sufficient to simply put the final
dump function after the call to smfi_main(), i.e. before
returning normally from main(). I don't think it is
necessary to use atexit() at all.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Gesch\ufffdftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht M\ufffdn-
chen, HRB 125758, Gesch\ufffdftsf\ufffdhrer: Maik Bachmann, Olaf Erb, Ralf Gebhart
Any opinions expressed in this message are personal to the author and may
not necessarily reflect the opinions of secnetix GmbH & Co KG in any way.
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"FreeBSD is Yoda, Linux is Luke Skywalker"
-- Daniel C. SobralMessage
Re: [milter-greylist] dbdump command
2007-02-23 by Oliver Fromme
Attachments
- No local attachments were found for this message.