Commit fa05a534 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac575] Merge branch 'master' into work/ports/auth

Master contains fix of #338, which influences this code quite a lot.
The merge includes not only the code-level conflict resolutions, but
also logic-level conflicts and enabling of the tests that failed because
of #338.

Conflicts:
	src/bin/auth/tests/Makefile.am
	src/bin/resolver/Makefile.am
	src/bin/resolver/resolver.cc
	src/bin/resolver/tests/Makefile.am
	src/bin/resolver/tests/resolver_config_unittest.cc
	src/lib/Makefile.am
parents 8ffbcda5 0a9ce967
182. [func] jinmei
Support cppcheck for static code check on C++ code. If cppcheck
is available, 'make cppcheck' on the top source directory will run
the checker and should cleanly complete with an exit code of 0
(at least with cppcheck 1.47).
Note: the suppression list isn't included in the final
distributions. It should be created by hand or retrieved from
the git repository.
(Trac #613, git b973f67520682b63ef38b1451d309be9f4f4b218)
181. [func] feng
Add stop interface into dns server, so we can stop each running
server individually. With it, user can reconfigure her running server
with different ip address or port.
(Trac #388, git 6df94e2db856c1adc020f658cc77da5edc967555)
180. [build] jreed
Fix custom DESTDIR for make install. Patch from Jan Engelhardt.
(Trac #629, git 5ac67ede03892a5eacf42ce3ace1e4e376164c9f)
bind10-devel-20110224 released on February 24, 2011
179. [func] vorner
It is possible to start and stop resolver and authoritative
server without restart of the whole system. Change of the
configuration (Boss/start_auth and Boss/start_resolver) is
enough.
(Trac #565, git 0ac0b4602fa30852b0d86cc3c0b4730deb1a58fe)
178. [func] jelte
Resolver now makes (limited) use of the cache
(Trac #491, git 8b41f77f0099ddc7ca7d34d39ad8c39bb1a8363c)
177. [func] stephen
The upstream fetch code in asiolink is now protocol agnostic to
allow for the addition of fallback to TCP if a fetch response
indicates truncation.
(Trac #554, git 9739cbce2eaffc7e80640db58a8513295cf684de)
176. [func] zhang likun
src/lib/cache: Rename one interface: from lookupClosestRRset()
to lookupDeepestNS(), and remove one parameter of it.
......
......@@ -70,6 +70,13 @@ clean-coverage: clean-cpp-coverage clean-python-coverage
report-coverage: report-cpp-coverage report-python-coverage
# for static C++ check using cppcheck (when available)
cppcheck:
cppcheck --enable=all --suppressions src/cppcheck-suppress.lst \
--quiet --error-exitcode=1 \
--template '{file}:{line}: check_fail: {message} ({severity},{id})' \
src
#### include external sources in the distributed tarball:
EXTRA_DIST = ext/asio/README
EXTRA_DIST += ext/asio/asio/local/stream_protocol.hpp
......
......@@ -14,12 +14,12 @@ five year plan are described here:
https://bind10.isc.org/wiki/Year2Milestones
This release includes the bind10 master process, b10-msgq message
bus, b10-auth authoritative DNS server (with SQLite3 backend),
b10-resolver forwarding DNS server, b10-cmdctl remote control daemon,
b10-cfgmgr configuration manager, b10-xfrin AXFR inbound service,
b10-xfrout outgoing AXFR service, b10-zonemgr secondary manager,
b10-stats statistics collection and reporting daemon, and a new
libdns++ library for C++ with a python wrapper.
bus, b10-auth authoritative DNS server (with SQLite3 and in-memory
backends), b10-resolver forwarding DNS server, b10-cmdctl remote
control daemon, b10-cfgmgr configuration manager, b10-xfrin AXFR
inbound service, b10-xfrout outgoing AXFR service, b10-zonemgr
secondary manager, b10-stats statistics collection and reporting
daemon, and a new libdns++ library for C++ with a python wrapper.
Documentation is included and also available via the BIND 10
website at http://bind10.isc.org/
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20110120, bind10-dev@isc.org)
AC_INIT(bind10-devel, 20110224, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
......@@ -14,18 +14,22 @@ AC_PROG_CXX
#
# On FreeBSD (and probably some others), clang++ does not meet an autoconf
# assumption in identifying libtool configuration regarding shared library:
# the configure script will execute "$CC -shared $CFLAGS -v -o" and expect
# the output contains -Lxxx or -Ryyy. This is the case for g++, but not for
# clang++, and, as a result, it will cause various errors in linking programs
# or running them with a shared object (such as some of our python scripts).
# the configure script will execute "$CC -shared $CFLAGS/$CXXFLAGS -v" and
# expect the output contains -Lxxx or -Ryyy. This is the case for g++, but
# not for clang++, and, as a result, it will cause various errors in linking
# programs or running them with a shared object (such as some of our python
# scripts).
# To work around this problem we define a temporary variable
# "CXX_LIBTOOL_LDFLAGS". It's expected to be defined as, e.g, "-L/usr/lib"
# to temporarily fake the output so that it will be compatible with that of
# g++.
CFLAGS_SAVED=$CFLAGS
CXXFLAGS_SAVED=$CXXFLAGS
CFLAGS="$CFLAGS $CXX_LIBTOOL_LDFLAGS"
CXXFLAGS="$CXXFLAGS $CXX_LIBTOOL_LDFLAGS"
AC_PROG_LIBTOOL
CFLAGS=$CFLAGS_SAVED
CXXFLAGS=$CXXFLAGS_SAVED
# Use C++ language
AC_LANG([C++])
......@@ -66,6 +70,11 @@ if test $enable_shared = no; then
AC_MSG_ERROR([BIND 10 requires shared libraries to be built])
fi
AC_ARG_ENABLE(boost-threads,
AC_HELP_STRING([--enable-boost-threads],
[use boost threads. Currently this only means using its locks instead of dummy locks, in the cache and NSAS]),
use_boost_threads=$enableval, use_boost_threads=no)
# allow configuring without setproctitle.
AC_ARG_ENABLE(setproctitle-check,
AC_HELP_STRING([--disable-setproctitle-check],
......@@ -193,8 +202,9 @@ if test "$setproctitle_check" = "yes" ; then
AC_MSG_RESULT(ok)
else
AC_MSG_RESULT(missing)
AC_MSG_ERROR([Missing setproctitle module. Either install it or provide --disable-setproctitle-check.
In that case we will continue, but naming of python processes will not work.])
AC_MSG_WARN([Missing setproctitle python module.
Use --disable-setproctitle-check to skip this check.
In this case we will continue, but naming of python processes will not work.])
fi
fi
......@@ -285,6 +295,7 @@ AC_SUBST(B10_CXXFLAGS)
AC_SEARCH_LIBS(inet_pton, [nsl])
AC_SEARCH_LIBS(recvfrom, [socket])
AC_SEARCH_LIBS(nanosleep, [rt])
# Checks for header files.
......@@ -363,57 +374,6 @@ if test "$lcov" != "no"; then
fi
AC_SUBST(USE_LCOV)
# Configure log4cxx header and library path
#
# If explicitly specified, use it.
AC_ARG_WITH([log4cxx],
AC_HELP_STRING([--with-log4cxx=PATH],
[specify directory where log4cxx is installed]),
[
log4cxx_include_path="${withval}/include";
log4cxx_library_path="${withval}/lib"
])
# This is an urgent fix to avoid regression due to log4cxx on some
# platforms. It should be cleaned up with a better fix.
if test "X$with_log4cxx" != "Xno"; then
# If not specified, try some common paths. These default to
# /usr/include and /usr/lib if not found
if test -z "$with_log4cxx"; then
log4cxxdirs="/usr/local /usr/pkg /opt /opt/local"
for d in $log4cxxdirs
do
if test -d $d/include/log4cxx; then
log4cxx_include_path=$d/include
log4cxx_library_path=$d/lib
break
fi
done
fi
CPPFLAGS_SAVES="$CPPFLAGS"
if test "${log4cxx_include_path}" ; then
LOG4CXX_INCLUDES="-I${log4cxx_include_path}"
CPPFLAGS="$CPPFLAGS $LOG4CXX_INCLUDES"
fi
AC_CHECK_HEADER([log4cxx/logger.h],, AC_MSG_ERROR([Missing log4cxx header files.]))
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(LOG4CXX_INCLUDES)
LOG4CXX_LDFLAGS="-llog4cxx";
if test "${log4cxx_library_path}"; then
LOG4CXX_LDFLAGS="-L${log4cxx_library_path} -llog4cxx"
fi
AC_SUBST(LOG4CXX_LDFLAGS)
# The following two lines are part of the urgent fix, and should be cleaned
# up with a better fix.
fi
AM_CONDITIONAL(USE_LOG4CXX, test "X${with_log4cxx}" != "Xno")
#
# Configure Boost header path
#
......@@ -443,62 +403,69 @@ AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BOOST_INCLUDES)
# Using boost::mutex can result in requiring libboost_thread with older
# versions of Boost. We'd like to avoid relying on a compiled Boost library
# whenever possible, so we need to check for it step by step.
#
# NOTE: another fix of this problem is to simply require newer versions of
# boost. If we choose that solution we should simplify the following tricky
# checks accordingly and all Makefile.am's that refer to NEED_LIBBOOST_THREAD.
AC_MSG_CHECKING(for boost::mutex)
CPPFLAGS_SAVES="$CPPFLAGS"
LIBS_SAVES="$LIBS"
CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS $MULTITHREADING_FLAG"
need_libboost_thread=0
need_sunpro_workaround=0
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (without libboost_thread)) ],
# there is one specific problem with SunStudio 5.10
# where including boost/thread causes a compilation failure
# There is a workaround in boost but it checks the version not being 5.10
# This will probably be fixed in the future, in which case this
# is only a temporary workaround
[ AC_TRY_LINK([
#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
#undef __SUNPRO_CC
#define __SUNPRO_CC 0x5090
#endif
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (with SUNOS workaround))
need_sunpro_workaround=1 ],
[ LIBS=" $LIBS -lboost_thread"
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (with libboost_thread))
need_libboost_thread=1 ],
[ AC_MSG_RESULT(no)
AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support, which does not appear to be available.
You may want to check the availability of the library or to upgrade Boost.])
])])])
CPPFLAGS="$CPPFLAGS_SAVES"
LIBS="$LIBS_SAVES"
AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
if test $need_sunpro_workaround = 1; then
AC_DEFINE([NEED_SUNPRO_WORKAROUND], [], [Need boost sunstudio workaround])
if test "${use_boost_threads}" = "yes" ; then
AC_DEFINE([USE_BOOST_THREADS], [], [Use boost threads])
# Using boost::mutex can result in requiring libboost_thread with older
# versions of Boost. We'd like to avoid relying on a compiled Boost library
# whenever possible, so we need to check for it step by step.
#
# NOTE: another fix of this problem is to simply require newer versions of
# boost. If we choose that solution we should simplify the following tricky
# checks accordingly and all Makefile.am's that refer to NEED_LIBBOOST_THREAD.
AC_MSG_CHECKING(for boost::mutex)
CPPFLAGS_SAVES="$CPPFLAGS"
LIBS_SAVES="$LIBS"
CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS $MULTITHREADING_FLAG"
need_libboost_thread=0
need_sunpro_workaround=0
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (without libboost_thread)) ],
# there is one specific problem with SunStudio 5.10
# where including boost/thread causes a compilation failure
# There is a workaround in boost but it checks the version not being 5.10
# This will probably be fixed in the future, in which case this
# is only a temporary workaround
[ AC_TRY_LINK([
#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
#undef __SUNPRO_CC
#define __SUNPRO_CC 0x5090
#endif
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (with SUNOS workaround))
need_sunpro_workaround=1 ],
[ LIBS=" $LIBS -lboost_thread"
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (with libboost_thread))
need_libboost_thread=1 ],
[ AC_MSG_RESULT(no)
AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support, which does not appear to be available.
You may want to check the availability of the library or to upgrade Boost.])
])])])
CPPFLAGS="$CPPFLAGS_SAVES"
LIBS="$LIBS_SAVES"
AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
if test $need_sunpro_workaround = 1; then
AC_DEFINE([NEED_SUNPRO_WORKAROUND], [], [Need boost sunstudio workaround])
fi
else
AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test "${use_boost_threads}" = "yes")
fi
#
# Check availability of gtest, which will be used for unit tests.
#
......@@ -823,8 +790,6 @@ dnl includes too
${PYTHON_LDFLAGS}
${PYTHON_LIB}
Boost: ${BOOST_INCLUDES}
log4cxx: ${LOG4CXX_INCLUDES}
${LOG4CXX_LDFLAGS}
SQLite: $SQLITE_CFLAGS
$SQLITE_LIBS
......
This diff is collapsed.
......@@ -52,7 +52,8 @@
<note>
<para>
BIND 10 provides a EDNS0- and DNSSEC-capable
authoritative DNS server and a forwarding DNS server.
authoritative DNS server and a caching recursive name server
which also provides forwarding.
</para>
</note>
......@@ -79,9 +80,7 @@
</para>
<note><para>
For this development prototype release, the only supported
data source backend is SQLite3. The authoritative server
requires SQLite 3.3.9 or newer.
The authoritative server requires SQLite 3.3.9 or newer.
The <command>b10-xfrin</command>, <command>b10-xfrout</command>,
and <command>b10-zonemgr</command> modules require the
libpython3 library and the Python _sqlite3.so module.
......@@ -1108,9 +1107,10 @@ This may be a temporary setting until then.
<note><para>
For the development prototype release, <command>b10-auth</command>
only supports the SQLite3 data source backend.
supports a SQLite3 data source backend and in-memory data source
backend.
Upcoming versions will be able to use multiple different
data sources, such as MySQL, Berkeley DB, or in-memory DB.
data sources, such as MySQL and Berkeley DB.
</para></note>
......@@ -1309,12 +1309,6 @@ what is XfroutClient xfr_client??
-->
</para>
<note><simpara>
The current version only provides a forwarding DNS server.
It does not cache and does not iterate to find answers.
It simply forwards the query on to another full resolver.
</simpara></note>
<para>
The main <command>bind10</command> process can be configured
to select to run either the authoritative or resolver.
......@@ -1331,15 +1325,26 @@ what is XfroutClient xfr_client??
</para>
<!-- TODO: -->
<note><simpara>
In the current version, the master <command>bind10</command>
process must be stopped and restarted to start up the resolver.
</simpara></note>
<para>
The master <command>bind10</command> will stop and start
the desired services.
</para>
<para>
Then the upstream address and port must be configured to
forward queries to, such as:
The resolver also needs to be configured to listen on an address
and port:
<screen>
&gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
&gt; <userinput>config commit</userinput>
</screen>
</para>
<!-- TODO: later the above will have some defaults -->
<para>
To enable forwarding, the upstream address and port must be
configured to forward queries to, such as:
<screen>
&gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
......@@ -1351,17 +1356,15 @@ what is XfroutClient xfr_client??
</para>
<para>
The resolver also needs to be configured to listen on an address
and port:
Normal iterative name service can be re-enabled by clearing the
forwarding address(es); for example:
<screen>
&gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
&gt; <userinput>config set Resolver/forward_addresses []</userinput>
&gt; <userinput>config commit</userinput>
</screen>
</para>
<!-- TODO: later the above will have some defaults -->
<!-- TODO: later try this
> config set Resolver/forward_addresses[0]/address "192.168.8.8"
......
......@@ -50,12 +50,13 @@ b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.la
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
b10_auth_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
b10_auth_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
b10_auth_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
b10_auth_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
b10_auth_LDADD += $(SQLITE_LIBS)
# TODO: config.h.in is wrong because doesn't honor pkgdatadir
# and can't use @datadir@ because doesn't expand default ${prefix}
b10_authdir = $(DESTDIR)$(pkgdatadir)
b10_authdir = $(pkgdatadir)
b10_auth_DATA = auth.spec
......@@ -21,6 +21,7 @@ query_bench_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
query_bench_LDADD += $(top_builddir)/src/lib/cc/libcc.la
query_bench_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
query_bench_LDADD += $(top_builddir)/src/lib/log/liblog.la
query_bench_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
query_bench_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
query_bench_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
query_bench_LDADD += $(SQLITE_LIBS)
......@@ -331,7 +331,7 @@ configureAuthServer(AuthSrv& server, ConstElementPtr config_set) {
parsers.push_back(parser);
}
} catch (const AuthConfigError& ex) {
throw ex; // simply rethrowing it
throw; // simply rethrowing it
} catch (const isc::Exception& ex) {
isc_throw(AuthConfigError, "Server configuration failed: " <<
ex.what());
......
......@@ -46,6 +46,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
run_unittests_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
endif
noinst_PROGRAMS = $(TESTS)
......@@ -128,8 +128,7 @@ TEST_F(AuthConfigTest, invalidListenAddressConfig) {
}
// Try setting addresses trough config
// TODO Enable after #388 is solved
TEST_F(AuthConfigTest, DISABLED_listenAddressConfig) {
TEST_F(AuthConfigTest, listenAddressConfig) {
isc::testutils::portconfig::listenAddressConfig(server);
}
......
......@@ -201,7 +201,7 @@ MockZone::find(const Name& name, const RRType& type,
// If not found but we have a target, fill it with all RRsets here
if (!found_domain->second.empty() && target != NULL) {
for (found_rrset = found_domain->second.begin();
found_rrset != found_domain->second.end(); found_rrset++) {
found_rrset != found_domain->second.end(); ++found_rrset) {
// Insert RRs under the domain name into target
target->addRRset(
boost::const_pointer_cast<RRset>(found_rrset->second));
......
......@@ -5,7 +5,7 @@ CLEANFILES = bind10 bind10.pyc
pkglibexecdir = $(libexecdir)/@PACKAGE@
bind10dir = $(DESTDIR)$(pkgdatadir)
bind10dir = $(pkgdatadir)
bind10_DATA = bob.spec
EXTRA_DIST = bob.spec
......@@ -19,7 +19,6 @@ bind10.8: bind10.xml
endif
# TODO: does this need $$(DESTDIR) also?
# this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
bind10: bind10.py
$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
......
......@@ -71,7 +71,7 @@ daemon to listen on\&. The default is 5300\&.
\fBNote\fR
.ps -1
.br
The Y1 prototype release uses a non\-default port for domain service\&.
This prototype release uses a non\-default port for domain service\&.
.sp .5v
.RE
.RE
......
......@@ -72,7 +72,7 @@ isc.util.process.rename(sys.argv[0])
# This is the version that gets displayed to the user.
# The VERSION string consists of the module name, the module version
# number, and the overall BIND 10 version number (set in configure.ac).
VERSION = "bind10 20101129 (BIND 10 @PACKAGE_VERSION@)"
VERSION = "bind10 20110223 (BIND 10 @PACKAGE_VERSION@)"
# This is for bind10.boottime of stats module
_BASETIME = time.gmtime()
......@@ -209,23 +209,68 @@ class BoB:
self.ccs = None
self.cfg_start_auth = True
self.cfg_start_resolver = False
self.started_auth_family = False
self.started_resolver_family = False
self.curproc = None
self.dead_processes = {}
self.msgq_socket_file = msgq_socket_file
self.nocache = nocache
self.processes = {}
self.expected_shutdowns = {}
self.runnable = False
self.uid = setuid
self.username = username
self.verbose = verbose
def config_handler(self, new_config):
# If this is initial update, don't do anything now, leave it to startup
if not self.runnable:
return
# Now we declare few functions used only internally here. Besides the
# benefit of not polluting the name space, they are closures, so we
# don't need to pass some variables
def start_stop(name, started, start, stop):
if not'start_' + name in new_config:
return
if new_config['start_' + name]:
if not started:
if self.uid is not None:
sys.stderr.write("[bind10] Starting " + name + " as " +
"a user, not root. This might fail.\n")
start()
else:
stop()
# These four functions are passed to start_stop (smells like functional
# programming little bit)
def resolver_on():
self.start_resolver(self.c_channel_env)
self.started_resolver_family = True
def resolver_off():
self.stop_resolver()
self.started_resolver_family = False
def auth_on():
self.start_auth(self.c_channel_env)
self.start_xfrout(self.c_channel_env)
self.start_xfrin(self.c_channel_env)
self.start_zonemgr(self.c_channel_env)
self.started_auth_family = True
def auth_off():
self.stop_zonemgr()
self.stop_xfrin()
self.stop_xfrout()
self.stop_auth()
self.started_auth_family = False
# The real code of the config handler function follows here
if self.verbose:
sys.stdout.write("[bind10] Handling new configuration: " +
str(new_config) + "\n")
start_stop('resolver', self.started_resolver_family, resolver_on,
resolver_off)
start_stop('auth', self.started_auth_family, auth_on, auth_off)
answer = isc.config.ccsession.create_answer(0)
return answer
# TODO
def command_handler(self, command, args):
if self.verbose:
......@@ -465,11 +510,12 @@ class BoB:
# XXX: we hardcode port 8080
self.start_simple("b10-cmdctl", c_channel_env, 8080)
def start_all_processes(self, c_channel_env):
def start_all_processes(self):
"""
Starts up all the processes. Any exception generated during the
starting of the processes is handled by the caller.
"""
c_channel_env = self.c_channel_env
self.start_msgq(c_channel_env)
self.start_cfgmgr(c_channel_env)
self.start_ccsession(c_channel_env)
......@@ -486,6 +532,7 @@ class BoB:
# ... and resolver (if selected):
if self.cfg_start_resolver:
self.start_resolver(c_channel_env)
self.started_resolver_family = True
# Everything after the main components can run as non-root.
# TODO: this is only temporary - once the privileged socket creator is
......@@ -499,6 +546,7 @@ class BoB:
self.start_xfrout(c_channel_env)
self.start_xfrin(c_channel_env)
self.start_zonemgr(c_channel_env)
self.started_auth_family = True
# ... and finally start the remaining processes
self.start_stats(c_channel_env)
......@@ -529,7 +577,8 @@ class BoB:
# Start all processes. If any one fails to start, kill all started
# processes and exit with an error indication.
try:
self.start_all_processes(c_channel_env)
self.c_channel_env = c_channel_env
self.start_all_processes()
except Exception as e:
self.kill_started_processes()
return "Unable to start " + self.curproc + ": " + str(e)
......@@ -551,10 +600,35 @@ class BoB:
self.cc_session.group_sendmsg(cmd, "Zonemgr", "Zonemgr")
self.cc_session.group_sendmsg(cmd, "Stats", "Stats")
def stop_process(self, process):
"""Stop the given process, friendly-like."""
# XXX nothing yet
pass