[kea-dev] Is it possible for hooks to hande server shutdown?

Dave Cole davecole at nbnco.com.au
Tue Oct 3 06:33:08 UTC 2017

> From: Baptiste Jonglez <baptiste at bitsofnetworks.org>
> On 01-10-17, Dave Cole wrote:
> > I have been working on a hook to publish events to a Kafka server.  The Kafka library creates a thread for communication with the server, which creates a problem when the kea server is stopped as there might still be messages that have not been delivered  to the Kafka server.
> > 
> > There is a simple way to monitor the Kafka thread.  Is there any way for the hook to detect server shutdown and delay process termination until delivery to Kafka has completed?
> Have a look at the "unload" hook point.  I'm not sure what would happen if
> you block too long in this function, though: the init system might get
> impatient and try to forcibly kill kea.
> Baptiste

I am not seeing the unload hook point being called on server shutdown.  That was what I was hoping would happen, but I see no evidence of that.

More information about the kea-dev mailing list