similar way as other hook libraries by the ``kea-dhcp4`` and
``kea-dhcp6`` processes.
-::
-
- "Dhcp4": {
- "hooks-libraries": [
- { "library": "/usr/local/lib/libdhcp_run_script.so",
- "parameters": {
- "name": "/path_to/script_name.sh",
- "sync": false
- }
- },
- ...
- ]
- }
-
-::
+.. code-block:: json
- "Dhcp6": {
+ {
"hooks-libraries": [
- { "library": "/usr/local/lib/libdhcp_run_script.so",
+ {
+ "library": "/usr/local/lib/libdhcp_run_script.so",
"parameters": {
"name": "/path_to/script_name.sh",
"sync": false
}
- },
- ...
+ }
]
}
-
The parameters contain the 'name' which indicates the path to the external
script to be called on each hookpoint, and also the 'sync' option to be able
to wait synchronously for the script to finish execution.
will not wait for the execution to finish, causing all the OUT parameters of
the script (including next step) to be ignored.
-
.. note::
Currently the functionality underneath 'sync' parameter is not implemented
and enabling synchronous calls to external script is not supported.
-
.. _hooks-run-script-hook-points:
This library has several hook points functions implemented which will be
LEASE6_PREFERRED_LIFETIME
LEASE6_PREFIX_LEN
LEASE6_TYPE
-
-
.. include:: hooks-bootp.rst
-.. include:: hooks-cb-cmds.rst
.. include:: hooks-class-cmds.rst
+.. include:: hooks-cb-cmds.rst
.. include:: hooks-ha.rst
+.. include:: hooks-stat-cmds.rst
+.. include:: hooks-radius.rst
.. include:: hooks-host-cache.rst
.. include:: hooks-lease-query.rst
-.. include:: hooks-radius.rst
.. include:: hooks-run-script.rst
-.. include:: hooks-stat-cmds.rst
.. _user-context-hooks:
RunScriptImpl::RunScriptImpl() : name_(), sync_(false) {
}
-RunScriptImpl::~RunScriptImpl() {
-}
-
void
RunScriptImpl::configure(LibraryHandle& handle) {
ConstElementPtr name = handle.getParameter("name");