[Kea-users] New Kea hook to call external scripts: kea-hook-runscript
Baptiste Jonglez
baptiste at bitsofnetworks.org
Tue Aug 29 22:41:32 UTC 2017
On 29-08-17, Tomek Mrugalski wrote:
> I always thought about writing this kind of hook, but never had time for
> that and hoped someone would write it one day. And here you are. Great!
>
> Thanks for writing it and sharing. I have not tested it yet, but the
> code looks good at first glance.
Cool, thanks! If/when you use it, it will be interesting to share your
use-cases. I'm sure there are tons of unanticipated use-cases.
> One thing you should consider in the future is that if the script takes
> a long time to execute, it will freeze whole Kea execution. You may add
> a knob that lets the user pick - whether he wants to wait for the script
> completion or not.
Hmm, I'm not sure it's such a good idea. Because then, the script would
need to handle concurrent executions, which quickly becomes a mess.
Locking is a solution, but you would have to be careful not to create a
fork-bomb with all those scripts waiting for a lock...
For potential « heavyweight scripts » use-cases, I think a better solution
would be a standalone process running alongside Kea, and a way for Kea to
communicate information to this standalone process (for instance via a
Unix socket). Or just write a custom Kea hook. Anyway, my use-case only
involves small shell scripts that should not block, so I'll leave this for
someone else to think about :)
Thanks,
Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20170830/98de63fd/attachment.bin>
More information about the Kea-users
mailing list