[kea-dev] Is it possible for hooks to hande server shutdown?
Thomas Markwalder
tmark at isc.org
Fri Oct 6 10:59:28 UTC 2017
On 10/5/17 8:57 PM, Dave Cole wrote:
>> The load and unload points are in the same file wrapped in the same extern "C".
>>
>> In my in-expect browsing of the code I could not see any way that the unload hook was being called on server exit. I was just hoping someone with a clue would confirm that for me, and maybe suggest a way to achieve the same effect.
>>
>> Using onexit is not going to work since a hook reload would almost certainly cause a segfault during server exit.
> I do not pretend to understand what is going on, but when I built my hook on centos7, the unload callback is being invoked during server shutdown.
>
> Oh well...
> _______________________________________________
> kea-dev mailing list
> kea-dev at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-dev
Hi Dave:
Each configured hook library is owned by an instance of
isc::hooks::LibraryManager. Whenever a library needs to unloaded, it is
done through:
LibraryManager::unloadLibrary() -> LibraryManager::runUnload() ->
SomeHookLib::unload().
This chain is invoked by LibraryManager's destructor, so during a
shutdown the hook library unloads are automatically called, as each
LibraryManager gets destroyed.
Hope that answers your question.
Regards,
Thomas Markwalder
ISC Software Engineering
More information about the kea-dev
mailing list