<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">If I install the same python3 dependencies, the problem goes away. However, my python script is now throwing errors since it doesn't seem to be python3 compatible.<div class=""><br class=""></div><div class="">I'm using the packaged version available for debian 9. I guess it's compiled to use python3.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 26, 2018, at 6:12 AM, George Thessalonikefs via Unbound-users <<a href="mailto:unbound-users@nlnetlabs.nl" class="">unbound-users@nlnetlabs.nl</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hi Christopher,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The only way that I can reproduce the same unbound output is by</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">removing/renaming the file so that unbound cannot find it.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Your configuration seems correct but maybe some of the included</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">configurations introduce dubious options?</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Also, do you use a packaged version of unbound or you compile your own?</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">-- George</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 25/10/2018 22:52, Christopher Hearn via Unbound-users wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">This is what I have:<br class=""><br class="">server:<br class="">verbosity: 1<br class="">statistics-cumulative: "yes"<br class="">extended-statistics: "yes"<br class="">num-threads: 2<br class=""> interface: "0.0.0.0"<br class=""> <span class="Apple-converted-space"> </span>interface: "::0"<br class=""> <span class="Apple-converted-space"> </span>interface-automatic: yes<br class=""> <span class="Apple-converted-space"> </span>outgoing-port-permit: "32768-65535"<br class=""> outgoing-port-avoid: "0-32767"<br class=""> <span class="Apple-converted-space"> </span>chroot: ""<br class="">root-hints: "/etc/unbound/root.hints"<br class=""> <span class="Apple-converted-space"> </span>module-config: "validator python iterator"<br class=""> <span class="Apple-converted-space"> </span>directory: "/etc/unbound"<br class="">cache-max-ttl: 300<br class=""> <span class="Apple-converted-space"> </span>log-queries: no<br class=""> <span class="Apple-converted-space"> </span>do-not-query-localhost: no<br class=""> <span class="Apple-converted-space"> </span>include: /etc/unbound/unbound.local.d/*.conf<br class="">python:<br class=""> <span class="Apple-converted-space"> </span>python-script: "/etc/unbound/dns-backend.py"<br class="">remote-control:<br class="">control-enable: yes<br class="">include: "/etc/unbound/unbound.conf.d/*.conf"<br class=""><br class="">Here's what I see when I try to run unbound:<br class=""><br class="">unbound -dv -c unbound.conf<br class="">[1540500365] unbound[18398:0] notice: Start of unbound 1.6.0.<br class="">Traceback (most recent call last):<br class=""> <span class="Apple-converted-space"> </span>File "<string>", line 1, in <module><br class="">ImportError: No module named 'unboundmodule'<br class=""><br class="">However, it's there:<br class=""><br class="">ll /usr/lib/python2.7/dist-packages/ | grep unbound<br class="">-rw-r--r-- 1 root root 102230 Aug 27 2017 unboundmodule.py<br class="">-rw-r--r-- 1 root root 85737 Oct 19 15:05 unboundmodule.pyc<br class="">-rw-r--r-- 1 root root 36348 Aug 27 2017 unbound.py<br class="">-rw-r--r-- 1 root root 39760 Oct 19 15:05 unbound.pyc<br class="">-rw-r--r-- 1 root root 80016 Aug 27 2017 _unbound.x86_64-linux-gnu.so<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Oct 25, 2018, at 6:00 AM, <a href="mailto:unbound-users-request@nlnetlabs.nl" class="">unbound-users-request@nlnetlabs.nl</a><br class=""><<a href="mailto:unbound-users-request@nlnetlabs.nl" class="">mailto:unbound-users-request@nlnetlabs.nl</a>> wrote:<br class=""><br class="">Date: Wed, 24 Oct 2018 14:38:00 +0200<br class="">From: George Thessalonikefs <<a href="mailto:george@nlnetlabs.nl" class="">george@nlnetlabs.nl</a><br class=""><<a href="mailto:george@nlnetlabs.nl" class="">mailto:george@nlnetlabs.nl</a>>><br class="">To: <a href="mailto:unbound-users@nlnetlabs.nl" class="">unbound-users@nlnetlabs.nl</a><span class="Apple-converted-space"> </span><<a href="mailto:unbound-users@nlnetlabs.nl" class="">mailto:unbound-users@nlnetlabs.nl</a>><br class="">Subject: Re: unbound v1.6.0 python module on debian 9<br class="">Message-ID: <<a href="mailto:b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl" class="">b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl</a><br class=""><<a href="mailto:b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl" class="">mailto:b9059648-e1dd-2ecb-3b96-94b1097405f0@nlnetlabs.nl</a>>><br class="">Content-Type: text/plain; charset=utf-8<br class=""><br class="">Hi Christopher,<br class=""><br class="">What is the error you are getting from unbound?<br class="">Can you share some bits of your configuration file? I am mainly<br class="">interested in the following options:<br class=""> chroot:<br class=""> directory:<br class=""> module-config:<br class=""> python-script:<br class=""><br class="">-- George<br class=""><br class="">On 24/10/2018 14:29, Christopher Hearn via Unbound-users wrote:<br class=""><blockquote type="cite" class="">Thanks for the reply George. ?When I run what you suggested, I see<br class="">/usr/lib/python2.7/dist-packages, and the unboundmodule.py is indeed in<br class="">there. ?If I run my python script on it?s own from my shell, it works<br class="">fine. ?unbound itself still does not see it, nor any of the other<br class="">dependencies in that directory. ?Any idea why this might be?<br class=""><br class=""><blockquote type="cite" class="">On Oct 24, 2018, at 6:00 AM, <a href="mailto:unbound-users-request@nlnetlabs.nl" class="">unbound-users-request@nlnetlabs.nl</a><br class=""><<a href="mailto:unbound-users-request@nlnetlabs.nl" class="">mailto:unbound-users-request@nlnetlabs.nl</a>><br class=""><<a href="mailto:unbound-users-request@nlnetlabs.nl" class="">mailto:unbound-users-request@nlnetlabs.nl</a>> wrote:<br class=""><br class="">Date: Tue, 23 Oct 2018 18:13:23 +0200<br class="">From: George Thessalonikefs <<a href="mailto:george@nlnetlabs.nl" class="">george@nlnetlabs.nl</a><br class=""><<a href="mailto:george@nlnetlabs.nl" class="">mailto:george@nlnetlabs.nl</a>><br class=""><<a href="mailto:george@nlnetlabs.nl" class="">mailto:george@nlnetlabs.nl</a>>><br class="">To:<a href="mailto:?unbound-users@nlnetlabs.nl" class="">?unbound-users@nlnetlabs.nl</a><br class=""><<a href="mailto:?unbound-users@nlnetlabs.nl" class="">mailto:?unbound-users@nlnetlabs.nl</a>> <<a href="mailto:unbound-users@nlnetlabs.nl" class="">mailto:unbound-users@nlnetlabs.nl</a>><br class="">Subject: Re: unbound v1.6.0 python module on debian 9<br class="">Message-ID: <<a href="mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl" class="">014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl</a><br class=""><<a href="mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl" class="">mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl</a>><br class=""><<a href="mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl" class="">mailto:014e436d-11f6-3ce5-e488-011e8d2601a6@nlnetlabs.nl</a>>><br class="">Content-Type: text/plain; charset=utf-8<br class=""><br class="">Hi Christopher,<br class=""><br class="">On 23/10/2018 17:24, Christopher Hearn via Unbound-users wrote:<br class=""><blockquote type="cite" class="">I?m trying to set up a server running unbound and a python script.<br class="">?This is working OK on an older server running version 1.4.2. ?On the<br class="">newer one, I can?t seem to get unbound to see the python script<br class="">dependencies. ?I do recall on the old server, this was because chroot<br class="">was enabled. ?Once I disabled it in the config file via chroot: ??,<br class="">it was fine. ?It?s disabled on the new one too, but still doesn?t<br class="">seem to help. ?If I symlink the requested file from<br class="">/usr/lib/python2.7/dist-packages/unboundpython.py to /etc/unbound/,<br class="">that resolves that error, but more come up because of course it can?t<br class="">see the other libraries. ?This leads me to believe that unbound isn?t<br class="">looking out of /etc/unbound/ even though chroot is disabled. ?Is<br class="">there something else I?m missing?<br class=""><br class=""></blockquote><br class="">I am assuming that you want to use a python script with unbound's python<br class="">module.<br class=""><br class="">I see that when initializing the python module, unbound appends to the<br class="">sys path also the directory reported by Python as the<br class="">"platform-dependent include directory" [1].<br class=""><br class="">You can find that directory by starting up the Python interpreter (the<br class="">same that unbound will also use; in case of Python virtual environments)<br class="">and typing:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">import distutils.sysconfig<br class="">distutils.sysconfig.get_python_lib(1,0)<br class=""></blockquote></blockquote>'/usr/local/lib/python2.7/site-packages' (in my case)<br class=""><br class="">As a side note you can also achieve the same with chroot enabled but<br class="">then you would need to link the same python directory structure inside<br class="">the chroot in order for unbound to find the libraries.<br class=""><br class="">[1]<br class=""><a href="https://docs.python.org/3.7/distutils/apiref.html?highlight=get_python_lib#distutils.sysconfig.get_python_lib" class="">https://docs.python.org/3.7/distutils/apiref.html?highlight=get_python_lib#distutils.sysconfig.get_python_lib</a><br class=""><br class="">-- George</blockquote></blockquote></blockquote></blockquote></div></blockquote></div><br class=""></div></body></html>