[kea-dev] Suggestion for new hooks: server startup, shutdown, reload

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Mon Dec 1 16:35:26 UTC 2014


Hello Tomek and welcome back :)


After posting this I realized that the server already offered "load" and "unload" functions, which are sufficient for my needs.
I don't really need to distinguish these from the "start" / "shutdown" cases.

What could definitively be useful would be to add to the "load" function the capacity to access Kea's configuration (in read-only mode).

For now I have to re-parse the configuration file myself.
... which works, even if it's not ideal, so... this is not a high priority issue.
It would be nice to have this at some point in the future, though.


Regards,
Nicolas.



> -----Message d'origine-----
> De : Tomek Mrugalski [mailto:tomasz at isc.org] 
> Envoyé : lundi 1 décembre 2014 16:57
> À : Chaigneau, Nicolas; kea-dev at lists.isc.org
> Objet : Re: [kea-dev] Suggestion for new hooks: server startup, shutdown, reload
> 
> On 19.11.2014 17:04, Chaigneau, Nicolas wrote:
> > I think it could be extended with new hook points. What do you think of the following proposal ?
> > 
> > - "server startup" hook:
> > Triggered after server has been started, configuration read, subnets initialized, leases loaded from backend; and just before the server actually starts processing DHCP packets.
> > This would allow a hook library to:
> > - Read its configuration (if it has one)
> > - Perform the initialization steps it requires
> > - If something wrong happens it could report through an output error code, which would cause the server to stop (as when the main configuration is incorrect, for instance).
> > 
> > The hook should provide access to anything the hook library needs.
> > For my needs, I can think of the subnets collection and the leases collection. The list is open though.
> > 
> > - "server shutdown" hook:
> > Triggered just before the server is about to be shut down.
> > This would give a hook library a chance to perform some termination steps, if need be. Close handles, etc.
> > (although on Linux it's not strictly needed, it's still cleaner to do so).
> Both are useful, if you haven't done so, please submit a ticket and describe your proposal. (Apologies if you already did that. I just returned from 2 weeks vacation and I'm not entirely up to speed). We'll process it the usual way - review on a team call on Wednesday and assign it to a milestone.
> 
> > - "library reload" hook:
> > Triggered after the hook library is reloaded (after the server has 
> > processed the "libreload" command) I think the same possibilities as in "server startup" should be provided.
> Does it make sense? For a library, the libreload should be indistinguishable from server shutdown and startup events, i.e. a library is unloaded and later loaded again. So I don't see any useful way to trigger such hook. If you need to know whether the library is loaded upon startup or as a result of libreload, we could possibly add an argument to load() that would signal that.
> 
> So, do you really need this? If yes, would an argument passed to load do the trick?
> 
> Tomek
> 
>
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



More information about the kea-dev mailing list