BIND 10 master, updated. 17f7af0d8a42a0a67a2aade5bc269533efeb840a Merge #1596
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 15 08:04:45 UTC 2012
The branch, master has been updated
via 17f7af0d8a42a0a67a2aade5bc269533efeb840a (commit)
via d7aff6bf2f4d45365305117fc19648b41e01c8ca (commit)
via 578f4a5e28f06ff84d75502d5484d995904947dd (commit)
via a9ade7fc8f8db95124c33bf475a59fd522914e49 (commit)
via 4c8164b131661552f3bc8e74806d4cbbe1cda1d1 (commit)
via f15c13fb80fd6512f31df035555392494c6dfbd2 (commit)
via da724029ca02951b51d63333394bac0d62dbb0a2 (commit)
via 0a78488462cb3d7998f8af45fc830c18648dd45e (commit)
via 809c35dc7dfc5e9fd0a498928f6aaff89049757c (commit)
via 9e363eaa09c4ab1945ba91a117cca7ea892ea78a (commit)
via 30219fe1326f00e468fd05bcf80e3ac47b5f4e3c (commit)
via 03a1f23dbeec538ee042f3f28203ea8cb3b29bfd (commit)
via 67167017ac51545493ed1adb6c7c33d3c19501c5 (commit)
via 716ae36b91bc71f72098b8c831c5e86c845a99bc (commit)
via 308d0c39eade6985c4f61feb215255cf2ec92abf (commit)
via f5ea0617661d39ecd576f3d997cf20009ac05048 (commit)
via 3d457417da0ef05512383a9ca4e2448882339344 (commit)
via 94ca32cb24762fc41c23631d7183c35f643545e7 (commit)
via 3d7ea0c377844f75053cf095f1e982a5bb6c32d7 (commit)
from 47ed2b145a1194d54b7d267d5addf74032f8acc3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 17f7af0d8a42a0a67a2aade5bc269533efeb840a
Merge: 47ed2b145a1194d54b7d267d5addf74032f8acc3 d7aff6bf2f4d45365305117fc19648b41e01c8ca
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Feb 15 08:48:39 2012 +0100
Merge #1596
commit d7aff6bf2f4d45365305117fc19648b41e01c8ca
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Feb 15 08:43:18 2012 +0100
[1596] Missed a CmdCtl's spec file
commit 578f4a5e28f06ff84d75502d5484d995904947dd
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 14 11:05:52 2012 +0100
[1596] Update spec files for everybody
Or, everybody who accepts a shutdown command with pid now. Stats needed
to be updated because it did call functions based on the name and spec
file somehow.
commit a9ade7fc8f8db95124c33bf475a59fd522914e49
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 14 10:41:37 2012 +0100
[1596] Fix obvious typo in makefile
commit 4c8164b131661552f3bc8e74806d4cbbe1cda1d1
Merge: 4d266d80beb7e0d8b1f45a4a4bc7cc39a1657486 f15c13fb80fd6512f31df035555392494c6dfbd2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 14 10:40:05 2012 +0100
Merge branch #1596
Conflicts:
src/bin/resolver/main.cc
commit f15c13fb80fd6512f31df035555392494c6dfbd2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 14 09:56:55 2012 +0100
[1596] Remove unneeded checks
They'd get caught by an exception anyway.
commit da724029ca02951b51d63333394bac0d62dbb0a2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 14 09:47:59 2012 +0100
[1596] Initialize in constructor
commit 0a78488462cb3d7998f8af45fc830c18648dd45e
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Feb 13 10:24:03 2012 -0800
[1596] a minor style fix: adding () for return.
commit 809c35dc7dfc5e9fd0a498928f6aaff89049757c
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Feb 13 12:40:37 2012 +0100
[1596] Reject invalid inputs
commit 9e363eaa09c4ab1945ba91a117cca7ea892ea78a
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Feb 13 12:17:35 2012 +0100
[1596] Some comments
commit 30219fe1326f00e468fd05bcf80e3ac47b5f4e3c
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Feb 13 11:23:59 2012 +0100
[1596] Add slashes to members
To keep some consistency.
commit 03a1f23dbeec538ee042f3f28203ea8cb3b29bfd
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 10 13:30:15 2012 +0100
[1596] Update test
Put some more realistic data there
commit 67167017ac51545493ed1adb6c7c33d3c19501c5
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 10 13:25:13 2012 +0100
[1596] Some review addressing
commit 716ae36b91bc71f72098b8c831c5e86c845a99bc
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 10 12:40:13 2012 +0100
[1596] Return deleted line
commit 308d0c39eade6985c4f61feb215255cf2ec92abf
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Feb 8 17:38:36 2012 -0800
[1596] constify
commit f5ea0617661d39ecd576f3d997cf20009ac05048
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 3 22:26:41 2012 +0100
[1596] Documentation
commit 3d457417da0ef05512383a9ca4e2448882339344
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 3 14:30:37 2012 +0100
[1596] Handle in resolver
No tests, it seems this architecture is hardly testable (function in the
main module). Once there are more commands (and there surely will be),
it should be slightly redesigned.
commit 94ca32cb24762fc41c23631d7183c35f643545e7
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 3 14:08:21 2012 +0100
[1596] Handle pid parameter in auth
commit 3d7ea0c377844f75053cf095f1e982a5bb6c32d7
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu Feb 2 15:41:53 2012 +0100
[1596] Send pid with a shutdown command
May break something. It is needed to go through applications and check
their shutdown handlers.
-----------------------------------------------------------------------
Summary of changes:
doc/guide/bind10-guide.html | 94 +++++----
doc/guide/bind10-guide.xml | 19 ++-
src/bin/auth/auth.spec.pre.in | 8 +-
src/bin/auth/auth_log.h | 2 +
src/bin/auth/auth_messages.mes | 4 +
src/bin/auth/auth_srv.h | 1 +
src/bin/auth/command.cc | 47 +++--
src/bin/auth/tests/command_unittest.cc | 240 +++++++++++++--------
src/bin/bind10/bind10_src.py.in | 21 ++-
src/bin/bind10/tests/bind10_test.py.in | 18 ++-
src/bin/cmdctl/cmdctl.spec.pre.in | 8 +-
src/bin/ddns/ddns.spec | 8 +-
src/bin/resolver/main.cc | 66 ++++--
src/bin/resolver/resolver.spec.pre.in | 8 +-
src/bin/resolver/resolver_messages.mes | 4 +
src/bin/stats/stats-httpd.spec | 8 +-
src/bin/stats/stats.py.in | 4 +-
src/bin/stats/stats.spec | 8 +-
src/bin/xfrin/xfrin.spec | 8 +-
src/bin/xfrout/xfrout.spec.pre.in | 8 +-
src/bin/zonemgr/zonemgr.spec.pre.in | 8 +-
src/lib/python/isc/bind10/component.py | 8 +-
src/lib/python/isc/bind10/tests/component_test.py | 8 +-
23 files changed, 417 insertions(+), 191 deletions(-)
-----------------------------------------------------------------------
diff --git a/doc/guide/bind10-guide.html b/doc/guide/bind10-guide.html
index 6abe287..4ae31f5 100644
--- a/doc/guide/bind10-guide.html
+++ b/doc/guide/bind10-guide.html
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BIND 10 Guide</title><link rel="stylesheet" href="./bind10-guide.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><meta name="description" content="BIND 10 is a framework that features Domain Name System (DNS) suite and Dynamic Host Configuration Protocol (DHCP) servers managed by Internet Systems Consortium (ISC). It includes DNS libraries, modular components for controlling authoritative and recursive DNS servers, and experimental DHCPv4 and DHCPv6 servers. This is the reference guide for BIND 10 version 20120127. The most up-to-date version of this document (in PDF, HTML, and plain text formats), along with other documents for BIND 10, can be found at ."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="BIND 10 Guide"><div class="titlepage"><div><div><h1 class="title"><a name="id1168
229451102"></a>BIND 10 Guide</h1></div><div><h2 class="subtitle">Administrator Reference for BIND 10</h2></div><div><p class="releaseinfo">This is the reference guide for BIND 10 version
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BIND 10 Guide</title><link rel="stylesheet" type="text/css" href="./bind10-guide.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="description" content="BIND 10 is a framework that features Domain Name System (DNS) suite and Dynamic Host Configuration Protocol (DHCP) servers managed by Internet Systems Consortium (ISC). It includes DNS libraries, modular components for controlling authoritative and recursive DNS servers, and experimental DHCPv4 and DHCPv6 servers. This is the reference guide for BIND 10 version 20120127. The most up-to-date version of this document (in PDF, HTML, and plain text formats), along with other documents for BIND 10, can be found at ."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="BIND 10 Guide"><div class="titlepage"><div><div><h1 class="title"><a name="idm148
92896"></a>BIND 10 Guide</h1></div><div><h2 class="subtitle">Administrator Reference for BIND 10</h2></div><div><p class="releaseinfo">This is the reference guide for BIND 10 version
20120127.</p></div><div><p class="copyright">Copyright © 2010-2012 Internet Systems Consortium, Inc.</p></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p>BIND 10 is a framework that features Domain Name System
(DNS) suite and Dynamic Host Configuration Protocol (DHCP)
servers managed by Internet Systems Consortium (ISC). It
@@ -10,9 +10,9 @@
The most up-to-date version of this document (in PDF, HTML,
and plain text formats), along with other documents for
BIND 10, can be found at <a class="ulink" href="http://bind10.isc.org/docs" target="_top">http://bind10.isc.org/docs</a>.
- </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#id1168229451188">Preface</a></span></dt><dd><dl><dt><span class="section"><a href="#acknowledgements">1. Acknowledgements</a></span></dt></dl></dd><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229451269">1.1. Supported Platforms</a></span></dt><dt><span class="section"><a href="#required-software">1.2. Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">1.3. Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">1.4. Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#build-requirements">2.1. Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstar
t">2.2. Quick start</a></span></dt><dt><span class="section"><a href="#install">2.3. Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229436789">2.3.1. Download Tar File</a></span></dt><dt><span class="section"><a href="#id1168229436809">2.3.2. Retrieve from Git</a></span></dt><dt><span class="section"><a href="#id1168229436870">2.3.3. Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168229436967">2.3.4. Build</a></span></dt><dt><span class="section"><a href="#id1168229436982">2.3.5. Install</a></span></dt><dt><span class="section"><a href="#id1168229437006">2.3.6. Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">3.1. Starting BIND 10</a></span></dt><dt><span class="section"><a href="#bind10.config">3.2. Configurati
on of started processes</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">6.1. Configuration specification for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229437939">8.1. Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168229438004">8.2. Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168229438035">8.3. Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a
></span></dt><dd><dl><dt><span class="section"><a href="#id1168229438166">9.1. Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#id1168229438203">9.2. Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">9.3. Secondary Manager</a></span></dt><dt><span class="section"><a href="#id1168229438317">9.4. Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#resolverserver">11. Recursive Name Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229438745">11.1. Access Control</a></span></dt><dt><span class="section"><a href="#id1168229438860">11.2. Forwarding</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp4">12. DHCPv4 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp4-usage">12.1. DHCPv4 Server Usage</a></span></dt><dt><span c
lass="section"><a href="#dhcp4-config">12.2. DHCPv4 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp4-std">12.3. Supported standards</a></span></dt><dt><span class="section"><a href="#dhcp4-limit">12.4. DHCPv4 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp6">13. DHCPv6 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp6-usage">13.1. DHCPv6 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp6-config">13.2. DHCPv6 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp6-std">13.3. Supported DHCPv6 Standards</a></span></dt><dt><span class="section"><a href="#dhcp6-limit">13.4. DHCPv6 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#libdhcp">14. libdhcp++ library</a></span></dt><dd><dl><dt><span class="section"><a href="#iface-detect">14.1. Interface detection</a></span></dt><dt><span class="section"><a href="#packet-handling"
>14.2. DHCPv4/DHCPv6 packet handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#statistics">15. Statistics</a></span></dt><dt><span class="chapter"><a href="#logging">16. Logging</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229439976">16.1. Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229439987">16.1.1. Loggers</a></span></dt><dt><span class="section"><a href="#id1168229440229">16.1.2. Output Options</a></span></dt><dt><span class="section"><a href="#id1168229440471">16.1.3. Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#id1168229440680">16.2. Logging Message Format</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>3.1. <a href="#id1168229437268"></a></dt></dl></div><div class="preface" title="Preface"><div class="titlepage"><div><div><h2 class="title"><a name="id1168229451188"></a>Preface</h2></div></div></div><div c
lass="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#acknowledgements">1. Acknowledgements</a></span></dt></dl></div><div class="section" title="1. Acknowledgements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="acknowledgements"></a>1. Acknowledgements</h2></div></div></div><p>ISC would like to acknowledge generous support for
+ </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="#idp61424">Preface</a></span></dt><dd><dl><dt><span class="section"><a href="#acknowledgements">1. Acknowledgements</a></span></dt></dl></dd><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#idp64344">1.1. Supported Platforms</a></span></dt><dt><span class="section"><a href="#required-software">1.2. Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">1.3. Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">1.4. Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#build-requirements">2.1. Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">2.2. Quick
start</a></span></dt><dt><span class="section"><a href="#install">2.3. Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#idp113000">2.3.1. Download Tar File</a></span></dt><dt><span class="section"><a href="#idp114472">2.3.2. Retrieve from Git</a></span></dt><dt><span class="section"><a href="#idp119504">2.3.3. Configure before the build</a></span></dt><dt><span class="section"><a href="#idp126792">2.3.4. Build</a></span></dt><dt><span class="section"><a href="#idp127848">2.3.5. Install</a></span></dt><dt><span class="section"><a href="#idp129504">2.3.6. Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">3.1. Starting BIND 10</a></span></dt><dt><span class="section"><a href="#bind10.config">3.2. Configuration of started processes</a></span></dt></dl></dd><
dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">6.1. Configuration specification for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#idp200360">8.1. Server Configurations</a></span></dt><dt><span class="section"><a href="#idp205096">8.2. Data Source Backends</a></span></dt><dt><span class="section"><a href="#idp207592">8.3. Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a></span></dt><dd><dl><dt><span class="section"><a href="#idp217864">
9.1. Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#idp220904">9.2. Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">9.3. Secondary Manager</a></span></dt><dt><span class="section"><a href="#idp11976">9.4. Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#resolverserver">11. Recursive Name Server</a></span></dt><dd><dl><dt><span class="section"><a href="#idp259896">11.1. Access Control</a></span></dt><dt><span class="section"><a href="#idp269088">11.2. Forwarding</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp4">12. DHCPv4 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp4-usage">12.1. DHCPv4 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp4-config">12.2. DHCPv4 Server Configuration</a></span></dt><dt><span c
lass="section"><a href="#dhcp4-std">12.3. Supported standards</a></span></dt><dt><span class="section"><a href="#dhcp4-limit">12.4. DHCPv4 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dhcp6">13. DHCPv6 Server</a></span></dt><dd><dl><dt><span class="section"><a href="#dhcp6-usage">13.1. DHCPv6 Server Usage</a></span></dt><dt><span class="section"><a href="#dhcp6-config">13.2. DHCPv6 Server Configuration</a></span></dt><dt><span class="section"><a href="#dhcp6-std">13.3. Supported DHCPv6 Standards</a></span></dt><dt><span class="section"><a href="#dhcp6-limit">13.4. DHCPv6 Server Limitations</a></span></dt></dl></dd><dt><span class="chapter"><a href="#libdhcp">14. libdhcp++ library</a></span></dt><dd><dl><dt><span class="section"><a href="#iface-detect">14.1. Interface detection</a></span></dt><dt><span class="section"><a href="#packet-handling">14.2. DHCPv4/DHCPv6 packet handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#s
tatistics">15. Statistics</a></span></dt><dt><span class="chapter"><a href="#logging">16. Logging</a></span></dt><dd><dl><dt><span class="section"><a href="#idp327280">16.1. Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#idp328272">16.1.1. Loggers</a></span></dt><dt><span class="section"><a href="#idp349480">16.1.2. Output Options</a></span></dt><dt><span class="section"><a href="#idp362088">16.1.3. Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#idp379592">16.2. Logging Message Format</a></span></dt></dl></dd></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>3.1. <a href="#idp150584"></a></dt></dl></div><div class="preface" title="Preface"><div class="titlepage"><div><div><h2 class="title"><a name="idp61424"></a>Preface</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#acknowledgements">1. Acknowledgements</a></span></dt></dl></
div><div class="section" title="1. Acknowledgements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="acknowledgements"></a>1. Acknowledgements</h2></div></div></div><p>ISC would like to acknowledge generous support for
BIND 10 development of DHCPv4 and DHCPv6 components provided
- by <a class="ulink" href="http://www.comcast.com/" target="_top">Comcast</a>.</p></div></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168229451269">1.1. Supported Platforms</a></span></dt><dt><span class="section"><a href="#required-software">1.2. Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">1.3. Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">1.4. Managing BIND 10</a></span></dt></dl></div><p>
+ by <a class="ulink" href="http://www.comcast.com/" target="_top">Comcast</a>.</p></div></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#idp64344">1.1. Supported Platforms</a></span></dt><dt><span class="section"><a href="#required-software">1.2. Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">1.3. Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">1.4. Managing BIND 10</a></span></dt></dl></div><p>
BIND is the popular implementation of a DNS server, developer
interfaces, and DNS tools.
BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
@@ -23,7 +23,7 @@
</p><p>
This guide covers the experimental prototype of
BIND 10 version 20120127.
- </p><div class="section" title="1.1. Supported Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229451269"></a>1.1. Supported Platforms</h2></div></div></div><p>
+ </p><div class="section" title="1.1. Supported Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp64344"></a>1.1. Supported Platforms</h2></div></div></div><p>
BIND 10 builds have been tested on Debian GNU/Linux 5 and unstable,
Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, CentOS
Linux 5.3, and MacOS 10.6.
@@ -152,7 +152,7 @@
and, of course, DNS. These include detailed developer
documentation and code examples.
- </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#build-requirements">2.1. Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">2.2. Quick start</a></span></dt><dt><span class="section"><a href="#install">2.3. Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229436789">2.3.1. Download Tar File</a></span></dt><dt><span class="section"><a href="#id1168229436809">2.3.2. Retrieve from Git</a></span></dt><dt><span class="section"><a href="#id1168229436870">2.3.3. Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168229436967">2.3.4. Build</a></span></dt><dt><span class="section"><a href="#id1168229436982">2.3.5. Install</a></span></dt><dt><span class="s
ection"><a href="#id1168229437006">2.3.6. Install Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="2.1. Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="build-requirements"></a>2.1. Building Requirements</h2></div></div></div><p>
+ </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#build-requirements">2.1. Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">2.2. Quick start</a></span></dt><dt><span class="section"><a href="#install">2.3. Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#idp113000">2.3.1. Download Tar File</a></span></dt><dt><span class="section"><a href="#idp114472">2.3.2. Retrieve from Git</a></span></dt><dt><span class="section"><a href="#idp119504">2.3.3. Configure before the build</a></span></dt><dt><span class="section"><a href="#idp126792">2.3.4. Build</a></span></dt><dt><span class="section"><a href="#idp127848">2.3.5. Install</a></span></dt><dt><span class="section"><a href="#idp129504">2
.3.6. Install Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="2.1. Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="build-requirements"></a>2.1. Building Requirements</h2></div></div></div><p>
In addition to the run-time requirements, building BIND 10
from source code requires various development include headers.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
@@ -214,14 +214,14 @@
the Git code revision control system or as a downloadable
tar file. It may also be available in pre-compiled ready-to-use
packages from operating system vendors.
- </p><div class="section" title="2.3.1. Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229436789"></a>2.3.1. Download Tar File</h3></div></div></div><p>
+ </p><div class="section" title="2.3.1. Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="idp113000"></a>2.3.1. Download Tar File</h3></div></div></div><p>
Downloading a release tar file is the recommended method to
obtain the source code.
</p><p>
The BIND 10 releases are available as tar file downloads from
<a class="ulink" href="ftp://ftp.isc.org/isc/bind10/" target="_top">ftp://ftp.isc.org/isc/bind10/</a>.
Periodic development snapshots may also be available.
- </p></div><div class="section" title="2.3.2. Retrieve from Git"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229436809"></a>2.3.2. Retrieve from Git</h3></div></div></div><p>
+ </p></div><div class="section" title="2.3.2. Retrieve from Git"><div class="titlepage"><div><div><h3 class="title"><a name="idp114472"></a>2.3.2. Retrieve from Git</h3></div></div></div><p>
Downloading this "bleeding edge" code is recommended only for
developers or advanced users. Using development code in a production
environment is not recommended.
@@ -255,7 +255,7 @@
<span class="command"><strong>autoheader</strong></span>,
<span class="command"><strong>automake</strong></span>,
and related commands.
- </p></div><div class="section" title="2.3.3. Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229436870"></a>2.3.3. Configure before the build</h3></div></div></div><p>
+ </p></div><div class="section" title="2.3.3. Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="idp119504"></a>2.3.3. Configure before the build</h3></div></div></div><p>
BIND 10 uses the GNU Build System to discover build environment
details.
To generate the makefiles using the defaults, simply run:
@@ -286,16 +286,16 @@
</p><p>
If the configure fails, it may be due to missing or old
dependencies.
- </p></div><div class="section" title="2.3.4. Build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229436967"></a>2.3.4. Build</h3></div></div></div><p>
+ </p></div><div class="section" title="2.3.4. Build"><div class="titlepage"><div><div><h3 class="title"><a name="idp126792"></a>2.3.4. Build</h3></div></div></div><p>
After the configure step is complete, to build the executables
from the C++ code and prepare the Python scripts, run:
</p><pre class="screen">$ <strong class="userinput"><code>make</code></strong></pre><p>
- </p></div><div class="section" title="2.3.5. Install"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229436982"></a>2.3.5. Install</h3></div></div></div><p>
+ </p></div><div class="section" title="2.3.5. Install"><div class="titlepage"><div><div><h3 class="title"><a name="idp127848"></a>2.3.5. Install</h3></div></div></div><p>
To install the BIND 10 executables, support files,
and documentation, run:
</p><pre class="screen">$ <strong class="userinput"><code>make install</code></strong></pre><p>
- </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div></div><div class="section" title="2.3.6. Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229437006"></a>2.3.6. Install Hierarchy</h3></div></div></div><p>
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div></div><div class="section" title="2.3.6. Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="idp129504"></a>2.3.6. Install Hierarchy</h3></div></div></div><p>
The following is the layout of the complete BIND 10 installation:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<code class="filename">bin/</code> —
@@ -395,7 +395,7 @@
during startup or shutdown. Unless specified, the component is started
in usual way. This is the list of components that need to be started
in a special way, with the value of special used for them:
- </p><div class="table"><a name="id1168229437268"></a><p class="title"><b>Table 3.1. </b></p><div class="table-contents"><table border="1"><colgroup><col align="left"><col align="left"><col align="left"></colgroup><thead><tr><th align="left">Component</th><th align="left">Special</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left">b10-auth</td><td align="left">auth</td><td align="left">Authoritative server</td></tr><tr><td align="left">b10-resolver</td><td align="left">resolver</td><td align="left">The resolver</td></tr><tr><td align="left">b10-cmdctl</td><td align="left">cmdctl</td><td align="left">The command control (remote control interface)</td></tr></tbody></table></div></div><p><br class="table-break">
+ </p><div class="table"><a name="idp150584"></a><p class="title"><b>Table 3.1. </b></p><div class="table-contents"><table border="1"><colgroup><col align="left" class="component"><col align="left" class="special"><col align="left" class="description"></colgroup><thead><tr><th align="left">Component</th><th align="left">Special</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left">b10-auth</td><td align="left">auth</td><td align="left">Authoritative server</td></tr><tr><td align="left">b10-resolver</td><td align="left">resolver</td><td align="left">The resolver</td></tr><tr><td align="left">b10-cmdctl</td><td align="left">cmdctl</td><td align="left">The command control (remote control interface)</td></tr></tbody></table></div></div><p><br class="table-break">
</p><p>
The kind specifies how a failure of the component should
be handled. If it is set to <span class="quote">“<span class="quote">dispensable</span>”</span>
@@ -451,7 +451,23 @@
</p><p>
In short, you should think twice before disabling something here.
- </p></div></div></div><div class="chapter" title="Chapter 4. Command channel"><div class="titlepage"><div><div><h2 class="title"><a name="msgq"></a>Chapter 4. Command channel</h2></div></div></div><p>
+ </p></div><p>
+ It is possible to start some components multiple times (currently
+ <span class="command"><strong>b10-auth</strong></span> and <span class="command"><strong>b10-resolzer</strong></span>).
+ You might want to do that to gain more performance (each one uses only
+ single core). Just put multiple entries under different names, like
+ this, with the same config:
+ </p><pre class="screen">> <strong class="userinput"><code>config add Boss/components b10-resolver-2</code></strong>
+> <strong class="userinput"><code>config set Boss/components/b10-resolver-2/special resolver</code></strong>
+> <strong class="userinput"><code>config set Boss/components/b10-resolver-2/kind needed</code></strong>
+> <strong class="userinput"><code>config commit</code></strong></pre><p>
+ </p><p>
+ However, this is work in progress and the support is not yet complete.
+ For example, each resolver will have its own cache, each authoritative
+ server will keep its own copy of in-memory data and there could be
+ problems with locking the sqlite database, if used. The configuration
+ might be changed to something more convenient in future.
+ </p></div></div><div class="chapter" title="Chapter 4. Command channel"><div class="titlepage"><div><div><h2 class="title"><a name="msgq"></a>Chapter 4. Command channel</h2></div></div></div><p>
The BIND 10 components use the <span class="command"><strong>b10-msgq</strong></span>
message routing daemon to communicate with other BIND 10 components.
The <span class="command"><strong>b10-msgq</strong></span> implements what is called the
@@ -607,12 +623,12 @@ shutdown
the details and relays (over a <span class="command"><strong>b10-msgq</strong></span> command
channel) the configuration on to the specified module.
</p><p>
- </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168229437939">8.1. Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168229438004">8.2. Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168229438035">8.3. Loading Master Zones Files</a></span></dt></dl></div><p>
+ </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#idp200360">8.1. Server Configurations</a></span></dt><dt><span class="section"><a href="#idp205096">8.2. Data Source Backends</a></span></dt><dt><span class="section"><a href="#idp207592">8.3. Loading Master Zones Files</a></span></dt></dl></div><p>
The <span class="command"><strong>b10-auth</strong></span> is the authoritative DNS server.
It supports EDNS0 and DNSSEC. It supports IPv6.
Normally it is started by the <span class="command"><strong>bind10</strong></span> master
process.
- </p><div class="section" title="8.1. Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229437939"></a>8.1. Server Configurations</h2></div></div></div><p>
+ </p><div class="section" title="8.1. Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp200360"></a>8.1. Server Configurations</h2></div></div></div><p>
<span class="command"><strong>b10-auth</strong></span> is configured via the
<span class="command"><strong>b10-cfgmgr</strong></span> configuration manager.
The module name is <span class="quote">“<span class="quote">Auth</span>”</span>.
@@ -632,7 +648,7 @@ This may be a temporary setting until then.
</p><div class="variablelist"><dl><dt><span class="term">shutdown</span></dt><dd>Stop the authoritative DNS server.
</dd></dl></div><p>
- </p></div><div class="section" title="8.2. Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438004"></a>8.2. Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ </p></div><div class="section" title="8.2. Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp205096"></a>8.2. Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
For the development prototype release, <span class="command"><strong>b10-auth</strong></span>
supports a SQLite3 data source backend and in-memory data source
backend.
@@ -646,7 +662,7 @@ This may be a temporary setting until then.
The default is <code class="filename">/usr/local/var/</code>.)
This data file location may be changed by defining the
<span class="quote">“<span class="quote">database_file</span>”</span> configuration.
- </p></div><div class="section" title="8.3. Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438035"></a>8.3. Loading Master Zones Files</h2></div></div></div><p>
+ </p></div><div class="section" title="8.3. Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp207592"></a>8.3. Loading Master Zones Files</h2></div></div></div><p>
RFC 1035 style DNS master zone files may imported
into a BIND 10 data source by using the
<span class="command"><strong>b10-loadzone</strong></span> utility.
@@ -675,7 +691,7 @@ This may be a temporary setting until then.
If you reload a zone already existing in the database,
all records from that prior zone disappear and a whole new set
appears.
- </p></div></div><div class="chapter" title="Chapter 9. Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrin"></a>Chapter 9. Incoming Zone Transfers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168229438166">9.1. Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#id1168229438203">9.2. Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">9.3. Secondary Manager</a></span></dt><dt><span class="section"><a href="#id1168229438317">9.4. Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></div><p>
+ </p></div></div><div class="chapter" title="Chapter 9. Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrin"></a>Chapter 9. Incoming Zone Transfers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#idp217864">9.1. Configuration for Incoming Zone Transfers</a></span></dt><dt><span class="section"><a href="#idp220904">9.2. Enabling IXFR</a></span></dt><dt><span class="section"><a href="#zonemgr">9.3. Secondary Manager</a></span></dt><dt><span class="section"><a href="#idp11976">9.4. Trigger an Incoming Zone Transfer Manually</a></span></dt></dl></div><p>
Incoming zones are transferred using the <span class="command"><strong>b10-xfrin</strong></span>
process which is started by <span class="command"><strong>bind10</strong></span>.
When received, the zone is stored in the corresponding BIND 10
@@ -693,7 +709,7 @@ This may be a temporary setting until then.
In the current development release of BIND 10, incoming zone
transfers are only available for SQLite3-based data sources,
that is, they don't work for an in-memory data source.
- </p></div><div class="section" title="9.1. Configuration for Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438166"></a>9.1. Configuration for Incoming Zone Transfers</h2></div></div></div><p>
+ </p></div><div class="section" title="9.1. Configuration for Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp217864"></a>9.1. Configuration for Incoming Zone Transfers</h2></div></div></div><p>
In practice, you need to specify a list of secondary zones to
enable incoming zone transfers for these zones (you can still
trigger a zone transfer manually, without a prior configuration
@@ -709,7 +725,7 @@ This may be a temporary setting until then.
> <strong class="userinput"><code>config commit</code></strong></pre><p>
(We assume there has been no zone configuration before).
- </p></div><div class="section" title="9.2. Enabling IXFR"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438203"></a>9.2. Enabling IXFR</h2></div></div></div><p>
+ </p></div><div class="section" title="9.2. Enabling IXFR"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp220904"></a>9.2. Enabling IXFR</h2></div></div></div><p>
As noted above, <span class="command"><strong>b10-xfrin</strong></span> uses AXFR for
zone transfers by default. To enable IXFR for zone transfers
for a particular zone, set the <strong class="userinput"><code>use_ixfr</code></strong>
@@ -761,7 +777,7 @@ This may be a temporary setting until then.
(i.e. no SOA record for it), <span class="command"><strong>b10-zonemgr</strong></span>
will automatically tell <span class="command"><strong>b10-xfrin</strong></span>
to transfer the zone in.
- </p></div><div class="section" title="9.4. Trigger an Incoming Zone Transfer Manually"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438317"></a>9.4. Trigger an Incoming Zone Transfer Manually</h2></div></div></div><p>
+ </p></div><div class="section" title="9.4. Trigger an Incoming Zone Transfer Manually"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp11976"></a>9.4. Trigger an Incoming Zone Transfer Manually</h2></div></div></div><p>
To manually trigger a zone transfer to retrieve a remote zone,
you may use the <span class="command"><strong>bindctl</strong></span> utility.
For example, at the <span class="command"><strong>bindctl</strong></span> prompt run:
@@ -818,7 +834,7 @@ Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</pre><p>
use the system wide TSIG configuration.
The way to specify zone specific configuration (ACLs, etc) is
likely to be changed, too.
- </p></div></div><div class="chapter" title="Chapter 11. Recursive Name Server"><div class="titlepage"><div><div><h2 class="title"><a name="resolverserver"></a>Chapter 11. Recursive Name Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168229438745">11.1. Access Control</a></span></dt><dt><span class="section"><a href="#id1168229438860">11.2. Forwarding</a></span></dt></dl></div><p>
+ </p></div></div><div class="chapter" title="Chapter 11. Recursive Name Server"><div class="titlepage"><div><div><h2 class="title"><a name="resolverserver"></a>Chapter 11. Recursive Name Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#idp259896">11.1. Access Control</a></span></dt><dt><span class="section"><a href="#idp269088">11.2. Forwarding</a></span></dt></dl></div><p>
The <span class="command"><strong>b10-resolver</strong></span> process is started by
<span class="command"><strong>bind10</strong></span>.
@@ -857,7 +873,7 @@ Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</pre><p>
</pre><p>
</p><p>(Replace the <span class="quote">“<span class="quote"><em class="replaceable"><code>2</code></em></span>”</span>
as needed; run <span class="quote">“<span class="quote"><strong class="userinput"><code>config show
- Resolver/listen_on</code></strong></span>”</span> if needed.)</p><div class="section" title="11.1. Access Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438745"></a>11.1. Access Control</h2></div></div></div><p>
+ Resolver/listen_on</code></strong></span>”</span> if needed.)</p><div class="section" title="11.1. Access Control"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp259896"></a>11.1. Access Control</h2></div></div></div><p>
By default, the <span class="command"><strong>b10-resolver</strong></span> daemon only accepts
DNS queries from the localhost (127.0.0.1 and ::1).
The <code class="option">Resolver/query_acl</code> configuration may
@@ -890,7 +906,7 @@ Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default)</pre><p>
</pre><p>(Replace the <span class="quote">“<span class="quote"><em class="replaceable"><code>2</code></em></span>”</span>
as needed; run <span class="quote">“<span class="quote"><strong class="userinput"><code>config show
Resolver/query_acl</code></strong></span>”</span> if needed.)</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This prototype access control configuration
- syntax may be changed.</p></div></div><div class="section" title="11.2. Forwarding"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229438860"></a>11.2. Forwarding</h2></div></div></div><p>
+ syntax may be changed.</p></div></div><div class="section" title="11.2. Forwarding"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp269088"></a>11.2. Forwarding</h2></div></div></div><p>
To enable forwarding, the upstream address and port must be
configured to forward queries to, such as:
@@ -1202,7 +1218,7 @@ eth0 fe80::21e:8cff:fe9b:7349
}
}
</pre><p>
- </p></div><div class="chapter" title="Chapter 16. Logging"><div class="titlepage"><div><div><h2 class="title"><a name="logging"></a>Chapter 16. Logging</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168229439976">16.1. Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168229439987">16.1.1. Loggers</a></span></dt><dt><span class="section"><a href="#id1168229440229">16.1.2. Output Options</a></span></dt><dt><span class="section"><a href="#id1168229440471">16.1.3. Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#id1168229440680">16.2. Logging Message Format</a></span></dt></dl></div><div class="section" title="16.1. Logging configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229439976"></a>16.1. Logging configuration</h2></div></div></div><p>
+ </p></div><div class="chapter" title="Chapter 16. Logging"><div class="titlepage"><div><div><h2 class="title"><a name="logging"></a>Chapter 16. Logging</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#idp327280">16.1. Logging configuration</a></span></dt><dd><dl><dt><span class="section"><a href="#idp328272">16.1.1. Loggers</a></span></dt><dt><span class="section"><a href="#idp349480">16.1.2. Output Options</a></span></dt><dt><span class="section"><a href="#idp362088">16.1.3. Example session</a></span></dt></dl></dd><dt><span class="section"><a href="#idp379592">16.2. Logging Message Format</a></span></dt></dl></div><div class="section" title="16.1. Logging configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp327280"></a>16.1. Logging configuration</h2></div></div></div><p>
The logging system in BIND 10 is configured through the
Logging module. All BIND 10 modules will look at the
@@ -1211,7 +1227,7 @@ eth0 fe80::21e:8cff:fe9b:7349
- </p><div class="section" title="16.1.1. Loggers"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229439987"></a>16.1.1. Loggers</h3></div></div></div><p>
+ </p><div class="section" title="16.1.1. Loggers"><div class="titlepage"><div><div><h3 class="title"><a name="idp328272"></a>16.1.1. Loggers</h3></div></div></div><p>
Within BIND 10, a message is logged through a component
called a "logger". Different parts of BIND 10 log messages
@@ -1232,7 +1248,7 @@ eth0 fe80::21e:8cff:fe9b:7349
(what to log), and the <code class="option">output_options</code>
(where to log).
- </p><div class="section" title="16.1.1.1. name (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440011"></a>16.1.1.1. name (string)</h4></div></div></div><p>
+ </p><div class="section" title="16.1.1.1. name (string)"><div class="titlepage"><div><div><h4 class="title"><a name="idp330520"></a>16.1.1.1. name (string)</h4></div></div></div><p>
Each logger in the system has a name, the name being that
of the component using it to log messages. For instance,
if you want to configure logging for the resolver module,
@@ -1305,7 +1321,7 @@ eth0 fe80::21e:8cff:fe9b:7349
<span class="quote">“<span class="quote">Auth.cache</span>”</span> logger will appear in the output
with a logger name of <span class="quote">“<span class="quote">b10-auth.cache</span>”</span>).
- </p></div><div class="section" title="16.1.1.2. severity (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440112"></a>16.1.1.2. severity (string)</h4></div></div></div><p>
+ </p></div><div class="section" title="16.1.1.2. severity (string)"><div class="titlepage"><div><div><h4 class="title"><a name="idp340304"></a>16.1.1.2. severity (string)</h4></div></div></div><p>
This specifies the category of messages logged.
Each message is logged with an associated severity which
@@ -1321,7 +1337,7 @@ eth0 fe80::21e:8cff:fe9b:7349
- </p></div><div class="section" title="16.1.1.3. output_options (list)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440162"></a>16.1.1.3. output_options (list)</h4></div></div></div><p>
+ </p></div><div class="section" title="16.1.1.3. output_options (list)"><div class="titlepage"><div><div><h4 class="title"><a name="idp344096"></a>16.1.1.3. output_options (list)</h4></div></div></div><p>
Each logger can have zero or more
<code class="option">output_options</code>. These specify where log
@@ -1331,7 +1347,7 @@ eth0 fe80::21e:8cff:fe9b:7349
The other options for a logger are:
- </p></div><div class="section" title="16.1.1.4. debuglevel (integer)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440179"></a>16.1.1.4. debuglevel (integer)</h4></div></div></div><p>
+ </p></div><div class="section" title="16.1.1.4. debuglevel (integer)"><div class="titlepage"><div><div><h4 class="title"><a name="idp345320"></a>16.1.1.4. debuglevel (integer)</h4></div></div></div><p>
When a logger's severity is set to DEBUG, this value
specifies what debug messages should be printed. It ranges
@@ -1340,7 +1356,7 @@ eth0 fe80::21e:8cff:fe9b:7349
If severity for the logger is not DEBUG, this value is ignored.
- </p></div><div class="section" title="16.1.1.5. additive (true or false)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440194"></a>16.1.1.5. additive (true or false)</h4></div></div></div><p>
+ </p></div><div class="section" title="16.1.1.5. additive (true or false)"><div class="titlepage"><div><div><h4 class="title"><a name="idp346760"></a>16.1.1.5. additive (true or false)</h4></div></div></div><p>
If this is true, the <code class="option">output_options</code> from
the parent will be used. For example, if there are two
@@ -1354,18 +1370,18 @@ eth0 fe80::21e:8cff:fe9b:7349
- </p></div></div><div class="section" title="16.1.2. Output Options"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229440229"></a>16.1.2. Output Options</h3></div></div></div><p>
+ </p></div></div><div class="section" title="16.1.2. Output Options"><div class="titlepage"><div><div><h3 class="title"><a name="idp349480"></a>16.1.2. Output Options</h3></div></div></div><p>
The main settings for an output option are the
<code class="option">destination</code> and a value called
<code class="option">output</code>, the meaning of which depends on
the destination that is set.
- </p><div class="section" title="16.1.2.1. destination (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440245"></a>16.1.2.1. destination (string)</h4></div></div></div><p>
+ </p><div class="section" title="16.1.2.1. destination (string)"><div class="titlepage"><div><div><h4 class="title"><a name="idp350616"></a>16.1.2.1. destination (string)</h4></div></div></div><p>
The destination is the type of output. It can be one of:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"> console </li><li class="listitem"> file </li><li class="listitem"> syslog </li></ul></div></div><div class="section" title="16.1.2.2. output (string)"><div class="titlepage"><div><div><h4 class="title"><a name="id1168229440277"></a>16.1.2.2. output (string)</h4></div></div></div><p>
+ </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"> console </li><li class="listitem"> file </li><li class="listitem"> syslog </li></ul></div></div><div class="section" title="16.1.2.2. output (string)"><div class="titlepage"><div><div><h4 class="title"><a name="idp352704"></a>16.1.2.2. output (string)</h4></div></div></div><p>
Depending on what is set as the output destination, this
value is interpreted as follows:
@@ -1387,12 +1403,12 @@ eth0 fe80::21e:8cff:fe9b:7349
The other options for <code class="option">output_options</code> are:
- </p><div class="section" title="16.1.2.2.1. flush (true of false)"><div class="titlepage"><div><div><h5 class="title"><a name="id1168229440361"></a>16.1.2.2.1. flush (true of false)</h5></div></div></div><p>
+ </p><div class="section" title="16.1.2.2.1. flush (true of false)"><div class="titlepage"><div><div><h5 class="title"><a name="idp358664"></a>16.1.2.2.1. flush (true of false)</h5></div></div></div><p>
Flush buffers after each log message. Doing this will
reduce performance but will ensure that if the program
terminates abnormally, all messages up to the point of
termination are output.
- </p></div><div class="section" title="16.1.2.2.2. maxsize (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="id1168229440371"></a>16.1.2.2.2. maxsize (integer)</h5></div></div></div><p>
+ </p></div><div class="section" title="16.1.2.2.2. maxsize (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="idp359528"></a>16.1.2.2.2. maxsize (integer)</h5></div></div></div><p>
Only relevant when destination is file, this is maximum
file size of output files in bytes. When the maximum
size is reached, the file is renamed and a new file opened.
@@ -1401,11 +1417,11 @@ eth0 fe80::21e:8cff:fe9b:7349
etc.)
</p><p>
If this is 0, no maximum file size is used.
- </p></div><div class="section" title="16.1.2.2.3. maxver (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="id1168229440453"></a>16.1.2.2.3. maxver (integer)</h5></div></div></div><p>
+ </p></div><div class="section" title="16.1.2.2.3. maxver (integer)"><div class="titlepage"><div><div><h5 class="title"><a name="idp360776"></a>16.1.2.2.3. maxver (integer)</h5></div></div></div><p>
Maximum number of old log files to keep around when
rolling the output file. Only relevant when
<code class="option">destination</code> is <span class="quote">“<span class="quote">file</span>”</span>.
- </p></div></div></div><div class="section" title="16.1.3. Example session"><div class="titlepage"><div><div><h3 class="title"><a name="id1168229440471"></a>16.1.3. Example session</h3></div></div></div><p>
+ </p></div></div></div><div class="section" title="16.1.3. Example session"><div class="titlepage"><div><div><h3 class="title"><a name="idp362088"></a>16.1.3. Example session</h3></div></div></div><p>
In this example we want to set the global logging to
write to the file <code class="filename">/var/log/my_bind10.log</code>,
@@ -1566,7 +1582,7 @@ Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
And every module will now be using the values from the
logger named <span class="quote">“<span class="quote">*</span>”</span>.
- </p></div></div><div class="section" title="16.2. Logging Message Format"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168229440680"></a>16.2. Logging Message Format</h2></div></div></div><p>
+ </p></div></div><div class="section" title="16.2. Logging Message Format"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp379592"></a>16.2. Logging Message Format</h2></div></div></div><p>
Each message written by BIND 10 to the configured logging
destinations comprises a number of components that identify
the origin of the message and, if the message indicates
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index c551c5f..eafbbd8 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -913,7 +913,24 @@ address, but the usual ones don't." mean? -->
In short, you should think twice before disabling something here.
</para>
</note>
-
+ <para>
+ It is possible to start some components multiple times (currently
+ <command>b10-auth</command> and <command>b10-resolzer</command>).
+ You might want to do that to gain more performance (each one uses only
+ single core). Just put multiple entries under different names, like
+ this, with the same config:
+ <screen>> <userinput>config add Boss/components b10-resolver-2</userinput>
+> <userinput>config set Boss/components/b10-resolver-2/special resolver</userinput>
+> <userinput>config set Boss/components/b10-resolver-2/kind needed</userinput>
+> <userinput>config commit</userinput></screen>
+ </para>
+ <para>
+ However, this is work in progress and the support is not yet complete.
+ For example, each resolver will have its own cache, each authoritative
+ server will keep its own copy of in-memory data and there could be
+ problems with locking the sqlite database, if used. The configuration
+ might be changed to something more convenient in future.
+ </para>
</section>
</chapter>
diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in
index 693e813..e202978 100644
--- a/src/bin/auth/auth.spec.pre.in
+++ b/src/bin/auth/auth.spec.pre.in
@@ -97,7 +97,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down authoritative DNS server",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
},
{
"command_name": "sendstats",
diff --git a/src/bin/auth/auth_log.h b/src/bin/auth/auth_log.h
index e0cae0f..33d4432 100644
--- a/src/bin/auth/auth_log.h
+++ b/src/bin/auth/auth_log.h
@@ -29,6 +29,8 @@ namespace auth {
// Debug messages indicating normal startup are logged at this debug level.
const int DBG_AUTH_START = DBGLVL_START_SHUT;
+// Debug messages upon shutdown
+const int DBG_AUTH_SHUT = DBGLVL_START_SHUT;
// Debug level used to log setting information (such as configuration changes).
const int DBG_AUTH_OPS = DBGLVL_COMMAND;
diff --git a/src/bin/auth/auth_messages.mes b/src/bin/auth/auth_messages.mes
index 4706690..44f8d4b 100644
--- a/src/bin/auth/auth_messages.mes
+++ b/src/bin/auth/auth_messages.mes
@@ -192,6 +192,10 @@ reason for the failure is included in the message.
Initialization of the authoritative server has completed successfully
and it is entering the main loop, waiting for queries to arrive.
+% AUTH_SHUTDOWN asked to stop, doing so
+This is a debug message indicating the server was asked to shut down and it is
+complying to the request.
+
% AUTH_SQLITE3 nothing to do for loading sqlite3
This is a debug message indicating that the authoritative server has
found that the data source it is loading is an SQLite3 data source,
diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h
index ad61fd8..5383e5a 100644
--- a/src/bin/auth/auth_srv.h
+++ b/src/bin/auth/auth_srv.h
@@ -344,6 +344,7 @@ public:
/// \param type Type of a counter to get the value of
///
/// \return the value of the counter.
+
uint64_t getCounter(const AuthCounters::ServerCounterType type) const;
/// \brief Get the value of per Opcode counter in the Auth Counters.
diff --git a/src/bin/auth/command.cc b/src/bin/auth/command.cc
index 280558d..ad0d134 100644
--- a/src/bin/auth/command.cc
+++ b/src/bin/auth/command.cc
@@ -12,24 +12,23 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <string>
-
-#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
+#include <auth/command.h>
+#include <auth/auth_log.h>
+#include <auth/auth_srv.h>
+#include <cc/data.h>
+#include <datasrc/memory_datasrc.h>
+#include <config/ccsession.h>
#include <exceptions/exceptions.h>
-
#include <dns/rrclass.h>
-#include <cc/data.h>
-
-#include <datasrc/memory_datasrc.h>
+#include <string>
-#include <config/ccsession.h>
+#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
-#include <auth/auth_log.h>
-#include <auth/auth_srv.h>
-#include <auth/command.h>
+#include <sys/types.h>
+#include <unistd.h>
using boost::scoped_ptr;
using namespace isc::auth;
@@ -104,10 +103,30 @@ public:
virtual void exec(AuthSrv& server, isc::data::ConstElementPtr args) = 0;
};
-// Handle the "shutdown" command. No argument is assumed.
+// Handle the "shutdown" command. An optional parameter "pid" is used to
+// see if it is really for our instance.
class ShutdownCommand : public AuthCommand {
public:
- virtual void exec(AuthSrv& server, isc::data::ConstElementPtr) {
+ virtual void exec(AuthSrv& server, isc::data::ConstElementPtr args) {
+ // Is the pid argument provided?
+ if (args && args->contains("pid")) {
+ // If it is, we check it is the same as our PID
+
+ // This might throw in case the type is not an int, but that's
+ // OK, as it'll get converted to an error on higher level.
+ const int pid(args->get("pid")->intValue());
+ const pid_t my_pid(getpid());
+ if (my_pid != pid) {
+ // It is not for us
+ //
+ // Note that this is completely expected situation, if
+ // there are multiple instances of the server running and
+ // another instance is being shut down, we get the message
+ // too, due to the multicast nature of our message bus.
+ return;
+ }
+ }
+ LOG_DEBUG(auth_logger, DBG_AUTH_SHUT, AUTH_SHUTDOWN);
server.stop();
}
};
diff --git a/src/bin/auth/tests/command_unittest.cc b/src/bin/auth/tests/command_unittest.cc
index 8a82367..087ce81 100644
--- a/src/bin/auth/tests/command_unittest.cc
+++ b/src/bin/auth/tests/command_unittest.cc
@@ -14,14 +14,9 @@
#include <config.h>
-#include <cassert>
-#include <cstdlib>
-#include <string>
-#include <stdexcept>
-
-#include <boost/bind.hpp>
-
-#include <gtest/gtest.h>
+#include <auth/auth_srv.h>
+#include <auth/auth_config.h>
+#include <auth/command.h>
#include <dns/name.h>
#include <dns/rrclass.h>
@@ -33,14 +28,22 @@
#include <datasrc/memory_datasrc.h>
-#include <auth/auth_srv.h>
-#include <auth/auth_config.h>
-#include <auth/command.h>
-
#include <asiolink/asiolink.h>
#include <testutils/mockups.h>
+#include <cassert>
+#include <cstdlib>
+#include <string>
+#include <stdexcept>
+
+#include <boost/bind.hpp>
+
+#include <gtest/gtest.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
using namespace std;
using namespace isc::dns;
using namespace isc::data;
@@ -50,58 +53,119 @@ using namespace isc::config;
namespace {
class AuthCommandTest : public ::testing::Test {
protected:
- AuthCommandTest() : server(false, xfrout), rcode(-1) {
- server.setStatisticsSession(&statistics_session);
+ AuthCommandTest() :
+ server_(false, xfrout_),
+ rcode_(-1),
+ expect_rcode_(0),
+ itimer_(server_.getIOService())
+ {
+ server_.setStatisticsSession(&statistics_session_);
}
void checkAnswer(const int expected_code) {
- parseAnswer(rcode, result);
- EXPECT_EQ(expected_code, rcode);
+ parseAnswer(rcode_, result_);
+ EXPECT_EQ(expected_code, rcode_);
}
- MockSession statistics_session;
- MockXfroutClient xfrout;
- AuthSrv server;
- ConstElementPtr result;
- int rcode;
+ MockSession statistics_session_;
+ MockXfroutClient xfrout_;
+ AuthSrv server_;
+ ConstElementPtr result_;
+ // The shutdown command parameter
+ ConstElementPtr param_;
+ int rcode_, expect_rcode_;
+ isc::asiolink::IntervalTimer itimer_;
public:
void stopServer(); // need to be public for boost::bind
+ void dontStopServer(); // need to be public for boost::bind
};
TEST_F(AuthCommandTest, unknownCommand) {
- result = execAuthServerCommand(server, "no_such_command",
- ConstElementPtr());
- parseAnswer(rcode, result);
- EXPECT_EQ(1, rcode);
+ result_ = execAuthServerCommand(server_, "no_such_command",
+ ConstElementPtr());
+ parseAnswer(rcode_, result_);
+ EXPECT_EQ(1, rcode_);
}
TEST_F(AuthCommandTest, DISABLED_unexpectedException) {
// execAuthServerCommand() won't catch standard exceptions.
// Skip this test for now: ModuleCCSession doesn't seem to validate
// commands.
- EXPECT_THROW(execAuthServerCommand(server, "_throw_exception",
+ EXPECT_THROW(execAuthServerCommand(server_, "_throw_exception",
ConstElementPtr()),
runtime_error);
}
TEST_F(AuthCommandTest, sendStatistics) {
- result = execAuthServerCommand(server, "sendstats", ConstElementPtr());
+ result_ = execAuthServerCommand(server_, "sendstats", ConstElementPtr());
// Just check some message has been sent. Detailed tests specific to
// statistics are done in its own tests.
- EXPECT_EQ("Stats", statistics_session.getMessageDest());
+ EXPECT_EQ("Stats", statistics_session_.getMessageDest());
checkAnswer(0);
}
void
AuthCommandTest::stopServer() {
- result = execAuthServerCommand(server, "shutdown", ConstElementPtr());
- parseAnswer(rcode, result);
- assert(rcode == 0); // make sure the test stops when something is wrong
+ result_ = execAuthServerCommand(server_, "shutdown", param_);
+ parseAnswer(rcode_, result_);
+ assert(rcode_ == 0); // make sure the test stops when something is wrong
}
TEST_F(AuthCommandTest, shutdown) {
- isc::asiolink::IntervalTimer itimer(server.getIOService());
- itimer.setup(boost::bind(&AuthCommandTest::stopServer, this), 1);
- server.getIOService().run();
- EXPECT_EQ(0, rcode);
+ // Param defaults to empty/null pointer on creation
+ itimer_.setup(boost::bind(&AuthCommandTest::stopServer, this), 1);
+ server_.getIOService().run();
+ EXPECT_EQ(0, rcode_);
+}
+
+TEST_F(AuthCommandTest, shutdownCorrectPID) {
+ // Put the pid parameter there
+ const pid_t pid(getpid());
+ ElementPtr param(new isc::data::MapElement());
+ param->set("pid", ConstElementPtr(new isc::data::IntElement(pid)));
+ param_ = param;
+ // With the correct PID, it should act exactly the same as in case
+ // of no parameter
+ itimer_.setup(boost::bind(&AuthCommandTest::stopServer, this), 1);
+ server_.getIOService().run();
+ EXPECT_EQ(0, rcode_);
+}
+
+// This is like stopServer, but the server should not stop after the
+// command, it should be running
+void
+AuthCommandTest::dontStopServer() {
+ result_ = execAuthServerCommand(server_, "shutdown", param_);
+ parseAnswer(rcode_, result_);
+ EXPECT_EQ(expect_rcode_, rcode_);
+ rcode_ = -1;
+ // We run the stopServer now, to really stop the server.
+ // If it had stopped already, it won't be run and the rcode -1 will
+ // be left here.
+ param_ = ConstElementPtr();
+ itimer_.cancel();
+ itimer_.setup(boost::bind(&AuthCommandTest::stopServer, this), 1);
+}
+
+// If we provide something not an int, the PID is not really specified, so
+// act as if nothing came.
+TEST_F(AuthCommandTest, shutdownNotInt) {
+ // Put the pid parameter there
+ ElementPtr param(new isc::data::MapElement());
+ param->set("pid", ConstElementPtr(new isc::data::StringElement("pid")));
+ param_ = param;
+ expect_rcode_ = 1;
+ // It should reject to stop if the PID is not an int.
+ itimer_.setup(boost::bind(&AuthCommandTest::dontStopServer, this), 1);
+ server_.getIOService().run();
+ EXPECT_EQ(0, rcode_);
+}
+
+TEST_F(AuthCommandTest, shutdownIncorrectPID) {
+ // The PID = 0 should be taken by init, so we are not init and the
+ // PID should be different
+ param_ = Element::fromJSON("{\"pid\": 0}");
+ itimer_.setup(boost::bind(&AuthCommandTest::dontStopServer, this), 1);
+ server_.getIOService().run();
+ EXPECT_EQ(0, rcode_);
}
// A helper function commonly used for the "loadzone" command tests.
@@ -165,7 +229,7 @@ newZoneChecks(AuthSrv& server) {
}
TEST_F(AuthCommandTest, loadZone) {
- configureZones(server);
+ configureZones(server_);
ASSERT_EQ(0, system(INSTALL_PROG " " TEST_DATA_DIR
"/test1-new.zone.in "
@@ -174,118 +238,118 @@ TEST_F(AuthCommandTest, loadZone) {
"/test2-new.zone.in "
TEST_DATA_BUILDDIR "/test2.zone.copied"));
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\"}"));
checkAnswer(0);
- newZoneChecks(server);
+ newZoneChecks(server_);
}
TEST_F(AuthCommandTest, loadBrokenZone) {
- configureZones(server);
+ configureZones(server_);
ASSERT_EQ(0, system(INSTALL_PROG " " TEST_DATA_DIR
"/test1-broken.zone.in "
TEST_DATA_BUILDDIR "/test1.zone.copied"));
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\"}"));
checkAnswer(1);
- zoneChecks(server); // zone shouldn't be replaced
+ zoneChecks(server_); // zone shouldn't be replaced
}
TEST_F(AuthCommandTest, loadUnreadableZone) {
- configureZones(server);
+ configureZones(server_);
// install the zone file as unreadable
ASSERT_EQ(0, system(INSTALL_PROG " -m 000 " TEST_DATA_DIR
"/test1.zone.in "
TEST_DATA_BUILDDIR "/test1.zone.copied"));
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\"}"));
checkAnswer(1);
- zoneChecks(server); // zone shouldn't be replaced
+ zoneChecks(server_); // zone shouldn't be replaced
}
TEST_F(AuthCommandTest, loadZoneWithoutDataSrc) {
// try to execute load command without configuring the zone beforehand.
// it should fail.
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\"}"));
checkAnswer(1);
}
TEST_F(AuthCommandTest, loadSqlite3DataSrc) {
// For sqlite3 data source we don't have to do anything (the data source
// (re)loads itself automatically)
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"datasrc\": \"sqlite3\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"datasrc\": \"sqlite3\"}"));
checkAnswer(0);
}
TEST_F(AuthCommandTest, loadZoneInvalidParams) {
- configureZones(server);
+ configureZones(server_);
// null arg
- result = execAuthServerCommand(server, "loadzone", ElementPtr());
+ result_ = execAuthServerCommand(server_, "loadzone", ElementPtr());
checkAnswer(1);
// zone class is bogus
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"class\": \"no_such_class\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"class\": \"no_such_class\"}"));
checkAnswer(1);
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"class\": 1}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"class\": 1}"));
checkAnswer(1);
// unsupported zone class
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"class\": \"CH\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"class\": \"CH\"}"));
checkAnswer(1);
// unsupported data source class
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"datasrc\": \"not supported\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"datasrc\": \"not supported\"}"));
checkAnswer(1);
// data source is bogus
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"test1.example\","
- " \"datasrc\": 0}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"test1.example\","
+ " \"datasrc\": 0}"));
checkAnswer(1);
// origin is missing
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON("{}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON("{}"));
checkAnswer(1);
// zone doesn't exist in the data source
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON("{\"origin\": \"xx\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON("{\"origin\": \"xx\"}"));
checkAnswer(1);
// origin is bogus
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON(
- "{\"origin\": \"...\"}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON(
+ "{\"origin\": \"...\"}"));
checkAnswer(1);
- result = execAuthServerCommand(server, "loadzone",
- Element::fromJSON("{\"origin\": 10}"));
+ result_ = execAuthServerCommand(server_, "loadzone",
+ Element::fromJSON("{\"origin\": 10}"));
checkAnswer(1);
}
}
diff --git a/src/bin/bind10/bind10_src.py.in b/src/bin/bind10/bind10_src.py.in
index e8bfdef..faf1582 100755
--- a/src/bin/bind10/bind10_src.py.in
+++ b/src/bin/bind10/bind10_src.py.in
@@ -193,9 +193,13 @@ class BoB:
self.nocache = nocache
self.component_config = {}
# Some time in future, it may happen that a single component has
- # multple processes. If so happens, name "components" may be
- # inapropriate. But as the code isn't probably completely ready
- # for it, we leave it at components for now.
+ # multple processes (like a pipeline-like component). If so happens,
+ # name "components" may be inapropriate. But as the code isn't probably
+ # completely ready for it, we leave it at components for now. We also
+ # want to support multiple instances of a single component. If it turns
+ # out that we'll have a single component with multiple same processes
+ # or if we start multiple components with the same configuration (we do
+ # this now, but it might change) is an open question.
self.components = {}
# Simply list of components that died and need to wait for a
# restart. Components manage their own restart schedule now
@@ -649,14 +653,17 @@ class BoB:
self.__started = True
return None
- def stop_process(self, process, recipient):
+ def stop_process(self, process, recipient, pid):
"""
Stop the given process, friendly-like. The process is the name it has
- (in logs, etc), the recipient is the address on msgq.
+ (in logs, etc), the recipient is the address on msgq. The pid is the
+ pid of the process (if we have multiple processes of the same name,
+ it might want to choose if it is for this one).
"""
logger.info(BIND10_STOP_PROCESS, process)
- self.cc_session.group_sendmsg({'command': ['shutdown']}, recipient,
- recipient)
+ self.cc_session.group_sendmsg(isc.config.ccsession.
+ create_command('shutdown', {'pid': pid}),
+ recipient, recipient)
def component_shutdown(self, exitcode=0):
"""
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index 3a30a24..882824d 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -460,6 +460,22 @@ class TestBoB(unittest.TestCase):
# The drop_socket is not tested here, but in TestCacheCommands.
# It needs the cache mocks to be in place and they are there.
+ def test_stop_process(self):
+ """
+ Test checking the stop_process method sends the right message over
+ the message bus.
+ """
+ class DummySession():
+ def group_sendmsg(self, msg, group, instance="*"):
+ (self.msg, self.group, self.instance) = (msg, group, instance)
+ bob = BoB()
+ bob.cc_session = DummySession()
+ bob.stop_process('process', 'address', 42)
+ self.assertEqual('address', bob.cc_session.group)
+ self.assertEqual('address', bob.cc_session.instance)
+ self.assertEqual({'command': ['shutdown', {'pid': 42}]},
+ bob.cc_session.msg)
+
# Class for testing the BoB without actually starting processes.
# This is used for testing the start/stop components routines and
# the BoB commands.
@@ -598,7 +614,7 @@ class MockBob(BoB):
procinfo.pid = 14
return procinfo
- def stop_process(self, process, recipient):
+ def stop_process(self, process, recipient, pid):
procmap = { 'b10-auth': self.stop_auth,
'b10-resolver': self.stop_resolver,
'b10-xfrout': self.stop_xfrout,
diff --git a/src/bin/cmdctl/cmdctl.spec.pre.in b/src/bin/cmdctl/cmdctl.spec.pre.in
index 537b678..d04e2e3 100644
--- a/src/bin/cmdctl/cmdctl.spec.pre.in
+++ b/src/bin/cmdctl/cmdctl.spec.pre.in
@@ -31,7 +31,13 @@
{
"command_name": "shutdown",
"command_description": "shutdown cmdctl",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/ddns/ddns.spec b/src/bin/ddns/ddns.spec
index 07cd2a9..55dab5c 100644
--- a/src/bin/ddns/ddns.spec
+++ b/src/bin/ddns/ddns.spec
@@ -34,7 +34,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down DDNS",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc
index 55c0387..c56e6f3 100644
--- a/src/bin/resolver/main.cc
+++ b/src/bin/resolver/main.cc
@@ -14,18 +14,10 @@
#include <config.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <string>
-#include <iostream>
-
-#include <boost/foreach.hpp>
+#include <resolver/spec_config.h>
+#include <resolver/resolver.h>
+#include "resolver_log.h"
+#include "common.h"
#include <asiodns/asiodns.h>
#include <asiolink/asiolink.h>
@@ -47,16 +39,26 @@
#include <auth/common.h>
-#include <resolver/spec_config.h>
-#include <resolver/resolver.h>
-
#include <cache/resolver_cache.h>
#include <nsas/nameserver_address_store.h>
#include <log/logger_support.h>
#include <log/logger_level.h>
#include "resolver_log.h"
-#include "common.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <string>
+#include <iostream>
+
+#include <boost/foreach.hpp>
using namespace std;
using namespace isc::cc;
@@ -81,15 +83,31 @@ ConstElementPtr
my_command_handler(const string& command, ConstElementPtr args) {
ConstElementPtr answer = createAnswer();
- if (command == "print_message") {
- LOG_INFO(resolver_logger, RESOLVER_PRINT_COMMAND).arg(args);
- /* let's add that message to our answer as well */
- answer = createAnswer(0, args);
- } else if (command == "shutdown") {
- io_service.stop();
- }
+ try {
+ if (command == "print_message") {
+ LOG_INFO(resolver_logger, RESOLVER_PRINT_COMMAND).arg(args);
+ /* let's add that message to our answer as well */
+ answer = createAnswer(0, args);
+ } else if (command == "shutdown") {
+ // Is the pid argument provided?
+ if (args && args->contains("pid")) {
+ // If it is, we check it is the same as our PID
+ const int pid(args->get("pid")->intValue());
+ const pid_t my_pid(getpid());
+ if (my_pid != pid) {
+ // It is not for us (this is expected, see auth/command.cc
+ // and the ShutdownCommand there).
+ return (answer);
+ }
+ }
+ LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_SHUTDOWN);
+ io_service.stop();
+ }
- return (answer);
+ return (answer);
+ } catch (const std::exception& e) {
+ return (createAnswer(1, e.what()));
+ }
}
void
diff --git a/src/bin/resolver/resolver.spec.pre.in b/src/bin/resolver/resolver.spec.pre.in
index 076ef85..d6bb226 100644
--- a/src/bin/resolver/resolver.spec.pre.in
+++ b/src/bin/resolver/resolver.spec.pre.in
@@ -154,7 +154,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down recursive DNS server",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/resolver/resolver_messages.mes b/src/bin/resolver/resolver_messages.mes
index 7930c52..bd9c818 100644
--- a/src/bin/resolver/resolver_messages.mes
+++ b/src/bin/resolver/resolver_messages.mes
@@ -246,3 +246,7 @@ RESOLVER_QUERY_REJECTED case, the server does not return any response.
The log message shows the query in the form of <query name>/<query
type>/<query class>, and the client that sends the query in the form of
<Source IP address>#<source port>.
+
+% RESOLVER_SHUTDOWN asked to shut down, doing so
+A debug message noting that the server was asked to terminate and is
+complying to the request.
diff --git a/src/bin/stats/stats-httpd.spec b/src/bin/stats/stats-httpd.spec
index 6307135..783611d 100644
--- a/src/bin/stats/stats-httpd.spec
+++ b/src/bin/stats/stats-httpd.spec
@@ -47,7 +47,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down the stats httpd",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/stats/stats.py.in b/src/bin/stats/stats.py.in
index 537cf49..938a062 100755
--- a/src/bin/stats/stats.py.in
+++ b/src/bin/stats/stats.py.in
@@ -304,9 +304,11 @@ class Stats:
return isc.config.create_answer(
0, "Stats is up. (PID " + str(os.getpid()) + ")")
- def command_shutdown(self):
+ def command_shutdown(self, pid=None):
"""
handle shutdown command
+
+ The pid argument is ignored, it is here to match the signature.
"""
logger.info(STATS_RECEIVED_SHUTDOWN_COMMAND)
self.running = False
diff --git a/src/bin/stats/stats.spec b/src/bin/stats/stats.spec
index e716b62..d3bdcca 100644
--- a/src/bin/stats/stats.spec
+++ b/src/bin/stats/stats.spec
@@ -12,7 +12,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down the stats module",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
},
{
"command_name": "show",
diff --git a/src/bin/xfrin/xfrin.spec b/src/bin/xfrin/xfrin.spec
index c1ba61e..7ab1085 100644
--- a/src/bin/xfrin/xfrin.spec
+++ b/src/bin/xfrin/xfrin.spec
@@ -86,7 +86,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down xfrin module",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/xfrout/xfrout.spec.pre.in b/src/bin/xfrout/xfrout.spec.pre.in
index 0891a57..6a97dea 100644
--- a/src/bin/xfrout/xfrout.spec.pre.in
+++ b/src/bin/xfrout/xfrout.spec.pre.in
@@ -106,7 +106,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down Xfrout",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/bin/zonemgr/zonemgr.spec.pre.in b/src/bin/zonemgr/zonemgr.spec.pre.in
index 36f02df..defa203 100644
--- a/src/bin/zonemgr/zonemgr.spec.pre.in
+++ b/src/bin/zonemgr/zonemgr.spec.pre.in
@@ -63,7 +63,13 @@
{
"command_name": "shutdown",
"command_description": "Shut down Zonemgr",
- "command_args": []
+ "command_args": [
+ {
+ "item_name": "pid",
+ "item_type": "integer",
+ "item_optional": true
+ }
+ ]
}
]
}
diff --git a/src/lib/python/isc/bind10/component.py b/src/lib/python/isc/bind10/component.py
index 91b7064..091bfee 100644
--- a/src/lib/python/isc/bind10/component.py
+++ b/src/lib/python/isc/bind10/component.py
@@ -22,9 +22,9 @@ Dependencies between them are not yet handled. It might turn out they are
needed, in that case they will be added sometime in future.
This framework allows for a single process to be started multiple times (by
-specifying multiple components with the same configuration). However, the rest
-of the system might not handle such situation well, so until it is made so,
-it would be better to start each process at most once.
+specifying multiple components with the same configuration). We might want
+to add a more convenient support (like providing a count argument to the
+configuration). This is yet to be designed.
"""
import isc.log
@@ -408,7 +408,7 @@ class Component(BaseComponent):
self._boss.register_process(self.pid(), self)
def _stop_internal(self):
- self._boss.stop_process(self._process, self._address)
+ self._boss.stop_process(self._process, self._address, self.pid())
# TODO Some way to wait for the process that doesn't want to
# terminate and kill it would prove nice (or add it to boss somewhere?)
diff --git a/src/lib/python/isc/bind10/tests/component_test.py b/src/lib/python/isc/bind10/tests/component_test.py
index 95137a9..ec0e8af 100644
--- a/src/lib/python/isc/bind10/tests/component_test.py
+++ b/src/lib/python/isc/bind10/tests/component_test.py
@@ -553,11 +553,11 @@ class ComponentTests(BossUtils, unittest.TestCase):
self.assertEqual(42, component.pid())
self.assertEqual(component, self.__registered_processes.get(42))
- def stop_process(self, process, address):
+ def stop_process(self, process, address, pid):
"""
Part of pretending to be boss.
"""
- self.__stop_process_params = (process, address)
+ self.__stop_process_params = (process, address, pid)
def start_simple(self, process):
"""
@@ -573,9 +573,11 @@ class ComponentTests(BossUtils, unittest.TestCase):
component.start()
self.assertTrue(component.running())
self.assertEqual('component', self.__start_simple_params)
+ component.pid = lambda: 42
component.stop()
self.assertFalse(component.running())
- self.assertEqual(('component', 'Address'), self.__stop_process_params)
+ self.assertEqual(('component', 'Address', 42),
+ self.__stop_process_params)
def test_component_kill(self):
"""
More information about the bind10-changes
mailing list