Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python module: support multiple instances #6

Merged
merged 2 commits into from Jun 18, 2019
Merged

Python module: support multiple instances #6

merged 2 commits into from Jun 18, 2019

Conversation

episource
Copy link
Contributor

Currently, it's not possible to use multiple instances of the python module. Nevertheless, adding the word python to the module-config: option several times is not rejected by unbound. In the end, however, it's not a usable setup supported by unbound.

The proposed solution allows to reference the python module more than once within module-config: option. For each instance, a python-script: option needs to be added to the python: section, specifying the python script file to be used. The first python module picks up the first python-script: option, the second picks up the second script, and so on.

I've been successfully using this patch with unbound-1.6.0, 1.6.1, 1.6.4 and 1.7.0.

See also: https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=1213
(Pull-Requests were disabled when I created this ticket)

@episource
Copy link
Contributor Author

episource commented Apr 30, 2018

If you are willing to accept all of the pull requests #4, #5, #6, you could also consider merging dev/all-merged/master instead: All three patches have been merged into this single branch.

This commit adds proper support for multiple instances of the python
module: When more than one instance is added to the module list, the
first instance loads the first script specified in the `python:`
configuration section. The second instance loads the second script,
and so on.

When there are more module instances in the module list than there are
scripts in the `python:` section, an error is raised during
initialization and unbound won't start. When more scripts than module
instances are provided, the surplus scripts are ignored.
@wcawijngaards wcawijngaards merged commit bfae298 into NLnetLabs:master Jun 18, 2019
wcawijngaards added a commit that referenced this pull request Jun 18, 2019
Merge PR #6: Python module: support multiple instances
Merge PR #5: Python module: define constant MODULE_RESTART_NEXT
Merge PR #4: Python module: assign something useful to the per-query data store 'qdata'
wcawijngaards added a commit that referenced this pull request Jun 18, 2019
- Merge PR #5: Python module: define constant MODULE_RESTART_NEXT
- Merge PR #4: Python module: assign something useful to the
  per-query data store 'qdata'
Noted in Changelog.
@wcawijngaards
Copy link
Member

Thank you for the python changes. The pull requests did not exist yet when you created them. We moved to github, so we can insert them from here. I merged the all-merged branch as you suggested.

jedisct1 added a commit to jedisct1/unbound that referenced this pull request Jun 29, 2019
* nlnet/master: (22 commits)
  Nicer spelling and layout.
  - For NLnetLabs#45, check that 127.0.0.1 and ::1 are not used in unbound.conf   when do-not-query-localhost is turned on, or at default on,   unbound-checkconf prints a warning if it is found in forward-addr or   stub-addr statements.
  - Fix memleak in unit test, reported from the clang 8.0 static analyzer.
  - Fix python dict reference and double free in config.
  - Merge PR NLnetLabs#6: Python module: support multiple instances - Merge PR NLnetLabs#5: Python module: define constant MODULE_RESTART_NEXT - Merge PR NLnetLabs#4: Python module: assign something useful to the   per-query data store 'qdata' Noted in Changelog.
  - Added documentation to the ipset files (for doxygen output).
  - make depend
  - Fix to make unbound-control with ipset, remove unused variable,   use unsigned type because of comparison, and assign null instead   of compare with it.  Remade lex and yacc output.
  - PR NLnetLabs#28: IPSet module, by Kevin Chou.  Created a module to support   the ipset that could add the domain's ip to a list easily.   Needs libmnl, and --enable-ipset and config it, doc/README.ipset.md. - Fix to omit RRSIGs from addition to the ipset.
  - Fix for NLnetLabs#24: Fix abort due to scan of auth zone masters using old   address from previous scan.
  - Fix NLnetLabs#39: In libunbound, leftover logfile is close()d unpredictably.
  - Master contains version 1.9.3 in development.
  fix segmentation fault
  rollback the code
  bugfix
  performance improvement
  edit config parser to support ipset
  Add support for ipset
  Document how to configure multiple python modules
  Support multiple python module instances
  ...
@rma-shuyu rma-shuyu mentioned this pull request Jan 12, 2021
gthess pushed a commit to internetstandards/unbound that referenced this pull request Apr 9, 2021
Incorporate unbound_1.8.0_patch_unsupported_ds.diff into the source code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants