Commit 826ac1b1 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[1901] Replace 'boss' with 'b10-init' or 'b10_init'

parent cfa26ab8
......@@ -1301,11 +1301,11 @@ Available module names:
When 'help' is used as a command to a module, it shows the supported commands for the module; for example:
<screen>&gt; <userinput>Boss help</userinput>
Module Boss Master process
Module Init Master process
Available commands:
help Get help for module.
shutdown Shut down BIND 10
ping Ping the boss process
ping Ping the Init process
show_processes
List the running BIND 10 processes
</screen>
......@@ -2146,7 +2146,7 @@ AND_MATCH := "ALL": [ RULE_RAW, RULE_RAW, ... ]
<row><entry>b10-auth</entry><entry>auth</entry><entry>Authoritative DNS server</entry></row>
<row><entry>b10-resolver</entry><entry>resolver</entry><entry>DNS resolver</entry></row>
<row><entry>b10-cmdctl</entry><entry>cmdctl</entry><entry>Command control (remote control interface)</entry></row>
<!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in boss before the release -->
<!-- TODO Either add xfrin and xfrout as well or clean up the workarounds in b10-init before the release -->
</tbody>
</tgroup>
</table>
......@@ -2420,7 +2420,7 @@ can use various data source backends.
<simpara>Stop the authoritative DNS server.
This has an optional <varname>pid</varname> argument to
select the process ID to stop.
(Note that the BIND 10 boss process may restart this service
(Note that the BIND 10 init process may restart this service
if configured.)
</simpara>
</listitem>
......@@ -3340,7 +3340,7 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
both servers. DHCPv4-specific details are covered in <xref linkend="dhcp4"/>,
while those details specific to DHCPv6 are described in <xref linkend="dhcp6"/>
</para>
<section id="dhcp-install-configure">
<title>DHCP Database Installation and Configuration</title>
<para>
......@@ -3409,7 +3409,7 @@ $</screen>
</section>
</chapter>
<chapter id="dhcp4">
<title>The DHCPv4 Server</title>
......@@ -3502,7 +3502,7 @@ Dhcp4/subnet4 [] list (default)
The server comes with an in-memory database ("memfile") configured as the default
database. This is used for internal testing and is not supported. In addition,
it does not store lease information on disk: lease information will be lost if the
server is restarted.
server is restarted.
</para>
</footnote>, and so the server must be configured to
access the correct database with the appropriate credentials.
......@@ -3552,7 +3552,7 @@ Dhcp4/subnet4 [] list (default)
database. Improved password security will be added in a future version of BIND 10 DHCP</para>
</note>
</section>
<section id="dhcp4-address-config">
<title>Configuration of Address Pools</title>
<para>
......@@ -3782,7 +3782,7 @@ Dhcp6/lease-database/name "" string (default)
Dhcp6/lease-database/user "" string (default)
Dhcp6/lease-database/host "" string (default)
Dhcp6/lease-database/password "" string (default)
Dhcp6/subnet6/ list
Dhcp6/subnet6/ list
</screen>
</para>
<para>
......@@ -3813,7 +3813,7 @@ Dhcp6/subnet6/ list
The server comes with an in-memory database ("memfile") configured as the default
database. This is used for internal testing and is not supported. In addition,
it does not store lease information on disk: lease information will be lost if the
server is restarted.
server is restarted.
</para>
</footnote>, and so the server must be configured to
access the correct database with the appropriate credentials.
......@@ -3959,7 +3959,7 @@ Dhcp6/subnet6/ list
lines for clarity.)
</para>
</section>
<section id="dhcp6-config-subnets">
<title>Subnet Selection</title>
<para>
......@@ -3994,8 +3994,8 @@ Dhcp6/subnet6/ list
&gt; <userinput>config commit</userinput>
</screen>
</para>
</section>
</section>
</section>
<section id="dhcp6-serverid">
......
......@@ -53,8 +53,8 @@
<para>The <command>b10-auth</command> daemon provides the BIND 10
authoritative DNS server.
Normally it is started by the
<citerefentry><refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum></citerefentry>
boss process.
<citerefentry><refentrytitle>b10-init</refentrytitle><manvolnum>8</manvolnum></citerefentry>
process.
</para>
<para>
......@@ -194,7 +194,7 @@
<command>shutdown</command> exits <command>b10-auth</command>.
This has an optional <varname>pid</varname> argument to
select the process ID to stop.
(Note that the BIND 10 boss process may restart this service
(Note that the b10-init process may restart this service
if configured.)
</para>
......
......@@ -187,7 +187,7 @@ main(int argc, char* argv[]) {
// We delay starting listening to new commands/config just before we
// go into the main loop to avoid confusion due to mixture of
// synchronous and asynchronous operations (this would happen in
// initial communication with the boss that takes place in
// initial communication with b10-init that takes place in
// updateConfig() for listen_on and in initializing TSIG keys below).
// Until then all operations on the CC session will take place
// synchronously.
......
......@@ -43,11 +43,14 @@ import os
# from a directory relative to that, otherwise we use the ones
# installed on the system
if "B10_FROM_SOURCE" in os.environ:
SPECFILE_LOCATION = os.environ["B10_FROM_SOURCE"] + "/src/bin/bind10/bob.spec"
SPECFILE_LOCATION = os.environ["B10_FROM_SOURCE"] +\
"/src/bin/bind10/init.spec"
else:
PREFIX = "@prefix@"
DATAROOTDIR = "@datarootdir@"
SPECFILE_LOCATION = "@datadir@/@PACKAGE@/bob.spec".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
SPECFILE_LOCATION = "@datadir@/@PACKAGE@/init.spec"\
.replace("${datarootdir}", DATAROOTDIR)\
.replace("${prefix}", PREFIX)
import subprocess
import signal
......@@ -69,15 +72,15 @@ import isc.cc
import isc.util.process
import isc.net.parse
import isc.log
from isc.log_messages.bind10_messages import *
from isc.log_messages.init_messages import *
import isc.bind10.component
import isc.bind10.special_component
import isc.bind10.socket_cache
import libutil_io_python
import tempfile
isc.log.init("b10-boss", buffer=True)
logger = isc.log.Logger("boss")
isc.log.init("b10-init", buffer=True)
logger = isc.log.Logger("init")
# Pending system-wide debug level definitions, the ones we
# use here are hardcoded for now
......@@ -147,7 +150,7 @@ class ProcessInfo:
"""Function used before running a program that needs to run as a
different user."""
# First, put us into a separate process group so we don't get
# SIGINT signals on Ctrl-C (the boss will shut everthing down by
# SIGINT signals on Ctrl-C (b10-init will shut everthing down by
# other means).
os.setpgrp()
......@@ -161,7 +164,7 @@ class ProcessInfo:
else:
spawn_stderr = None
# Environment variables for the child process will be a copy of those
# of the boss process with any additional specific variables given
# of the b10-init process with any additional specific variables given
# on construction (self.env).
spawn_env = copy.deepcopy(os.environ)
spawn_env.update(self.env)
......@@ -198,7 +201,7 @@ class BoB:
Initialize the Boss of BIND. This is a singleton (only one can run).
The msgq_socket_file specifies the UNIX domain socket file that the
msgq process listens on. If verbose is True, then the boss reports
msgq process listens on. If verbose is True, then b10-init reports
what it is doing.
Data path and config filename are passed through to config manager
......@@ -287,7 +290,7 @@ class BoB:
for comp in self.__core_components:
if comp in comps:
raise Exception(comp + " is core component managed by " +
"bind10 boss, do not set it")
"b10-init, do not set it")
comps[comp] = self.__core_components[comp]
# Update the configuration
self._component_configurator.reconfigure(comps)
......@@ -313,7 +316,7 @@ class BoB:
# We use one-shot logger after setuid here. This will
# detect any permission issue regarding logging due to the
# result of setuid at the earliest opportunity.
isc.log.Logger("boss").info(BIND10_SETUID, self.__uid)
isc.log.Logger("b10-init").info(BIND10_SETUID, self.__uid)
except Exception as ex:
raise ChangeUserError('failed to change user: ' + str(ex))
......@@ -578,7 +581,7 @@ class BoB:
def register_process(self, pid, component):
"""
Put another process into boss to watch over it. When the process
Put another process into b10-init to watch over it. When the process
dies, the component.failed() is called with the exit code.
It is expected the info is a isc.bind10.component.BaseComponent
......@@ -741,7 +744,7 @@ class BoB:
logger.info(BIND10_SHUTDOWN)
# If ccsession is still there, inform rest of the system this module
# is stopping. Since everything will be stopped shortly, this is not
# really necessary, but this is done to reflect that boss is also
# really necessary, but this is done to reflect that b10-init is also
# 'just' a module.
self.ccs.send_stopping()
......@@ -943,7 +946,7 @@ class BoB:
def set_creator(self, creator):
"""
Registeres a socket creator into the boss. The socket creator is not
Registeres a socket creator into the b10-init. The socket creator is not
used directly, but through a cache. The cache is created in this
method.
......@@ -1078,7 +1081,7 @@ class BoB:
# global variables, needed for signal handlers
options = None
boss_of_bind = None
b10_init = None
def reaper(signal_number, stack_frame):
"""A child process has died (SIGCHLD received)."""
......@@ -1099,10 +1102,10 @@ def get_signame(signal_number):
def fatal_signal(signal_number, stack_frame):
"""We need to exit (SIGINT or SIGTERM received)."""
global options
global boss_of_bind
global b10_init
logger.info(BIND10_RECEIVED_SIGNAL, get_signame(signal_number))
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
boss_of_bind.runnable = False
b10_init.runnable = False
def process_rename(option, opt_str, value, parser):
"""Function that renames the process if it is requested by a option."""
......@@ -1224,7 +1227,7 @@ def remove_lock_files():
def main():
global options
global boss_of_bind
global b10_init
# Enforce line buffering on stdout, even when not a TTY
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), line_buffering=True)
......@@ -1287,32 +1290,32 @@ def main():
try:
# Go bob!
boss_of_bind = BoB(options.msgq_socket_file, options.data_path,
b10_init = BoB(options.msgq_socket_file, options.data_path,
options.config_file, options.clear_config,
options.verbose, options.nokill,
setuid, setgid, username, options.cmdctl_port,
options.wait_time)
startup_result = boss_of_bind.startup()
startup_result = b10_init.startup()
if startup_result:
logger.fatal(BIND10_STARTUP_ERROR, startup_result)
sys.exit(1)
boss_of_bind.init_socket_srv()
b10_init.init_socket_srv()
logger.info(BIND10_STARTUP_COMPLETE)
dump_pid(options.pid_file)
# Let it run
boss_of_bind.run(wakeup_pipe[0])
b10_init.run(wakeup_pipe[0])
# shutdown
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
boss_of_bind.shutdown()
b10_init.shutdown()
finally:
# Clean up the filesystem
unlink_pid_file(options.pid_file)
remove_lock_files()
if boss_of_bind is not None:
boss_of_bind.remove_socket_srv()
sys.exit(boss_of_bind.exitcode)
if b10_init is not None:
b10_init.remove_socket_srv()
sys.exit(b10_init.exitcode)
if __name__ == "__main__":
main()
......@@ -24,14 +24,14 @@
</refentryinfo>
<refmeta>
<refentrytitle>bind10</refentrytitle>
<refentrytitle>b10-init</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND10</refmiscinfo>
</refmeta>
<refnamediv>
<refname>bind10</refname>
<refpurpose>BIND 10 boss process</refpurpose>
<refname>b10-init</refname>
<refpurpose>BIND 10 init process</refpurpose>
</refnamediv>
<docinfo>
......@@ -43,7 +43,7 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>bind10</command>
<command>b10-init</command>
<arg><option>-c <replaceable>config-filename</replaceable></option></arg>
<arg><option>-i</option></arg>
<arg><option>-m <replaceable>file</replaceable></option></arg>
......@@ -68,14 +68,14 @@
<refsect1>
<title>DESCRIPTION</title>
<para>The <command>bind10</command> daemon starts up other
<para>The <command>b10-init</command> daemon starts up other
BIND 10 required daemons. It handles restarting of exiting
programs and also the shutdown of all managed daemons.</para>
<!-- TODO: list what it starts here? -->
<!-- TODO
<para>The configuration of the <command>bind10</command> daemon
<para>The configuration of the <command>b10-init</command> daemon
is defined in the TODO configuration file, as described in the
<citerefentry><refentrytitle>TODO</refentrytitle><manvolnum>5</manvolnum></citerefentry>
manual page.</para>
......@@ -169,7 +169,7 @@
<varlistentry>
<term><option>-i</option>, <option>--no-kill</option></term>
<listitem>
<para>When this option is passed, <command>bind10</command>
<para>When this option is passed, <command>b10-init</command>
does not send SIGTERM and SIGKILL signals to modules during
shutdown. (This option was introduced for use during
testing.)</para>
......@@ -180,8 +180,8 @@
<term><option>-u</option> <replaceable>user</replaceable>, <option>--user</option> <replaceable>name</replaceable></term>
<!-- TODO: example more detail. -->
<listitem>
<para>The username for <command>bind10</command> to run as.
<command>bind10</command> must be initially ran as the
<para>The username for <command>b10-init</command> to run as.
<command>b10-init</command> must be initially ran as the
root user to use this option.
The default is to run as the current user.</para>
</listitem>
......@@ -190,7 +190,7 @@
<varlistentry>
<term><option>--pid-file</option> <replaceable>filename</replaceable></term>
<listitem>
<para>If defined, the PID of the <command>bind10</command> is stored
<para>If defined, the PID of the <command>b10-init</command> is stored
in this file.
</para>
</listitem>
......@@ -203,7 +203,7 @@
<para>The name this process should have in tools like
<command>ps</command> or <command>top</command>. This
is handy if you have multiple versions/installations
of <command>bind10</command>.
of <command>b10-init</command>.
<!-- TODO: only supported with setproctitle feature
The default is the basename of ARG 0.
-->
......@@ -215,7 +215,7 @@ The default is the basename of ARG 0.
<term><option>-v</option>, <option>--verbose</option></term>
<listitem>
<para>Display more about what is going on for
<command>bind10</command> and its child processes.</para>
<command>b10-init</command> and its child processes.</para>
<!-- TODO: not true about all children yet -->
</listitem>
</varlistentry>
......@@ -245,7 +245,7 @@ TODO: configuration section
<para>
The configuration provides settings for components for
<command>bind10</command> to manage under
<command>b10-init</command> to manage under
<varname>/Boss/components/</varname>.
The default elements are:
</para>
......@@ -265,7 +265,7 @@ TODO: configuration section
<para>
(Note that the startup of <command>b10-sockcreator</command>,
<command>b10-cfgmgr</command>, and <command>b10-msgq</command>
is not configurable. They are hardcoded and <command>bind10</command>
is not configurable. They are hardcoded and <command>b10-init</command>
will not run without them.)
</para>
......@@ -296,12 +296,12 @@ sometime and I'd like it to teach to guess the address.
This defines how required a component is.
The possible settings for <varname>kind</varname> are:
<varname>core</varname> (system won't start if it won't
start and <command>bind10</command> will shutdown if
start and <command>b10-init</command> will shutdown if
a <quote>core</quote> component crashes),
<varname>dispensable</varname> (<command>bind10</command>
<varname>dispensable</varname> (<command>b10-init</command>
will restart failing component),
and
<varname>needed</varname> (<command>bind10</command>
<varname>needed</varname> (<command>b10-init</command>
will shutdown if component won't initially start, but
if crashes later, it will attempt to restart).
This setting is required.
......@@ -325,7 +325,7 @@ list
<varlistentry>
<term> <varname>priority</varname> </term>
<listitem>
<para>This is an integer. <command>bind10</command>
<para>This is an integer. <command>b10-init</command>
will start the components with largest priority numbers first.
</para>
</listitem>
......@@ -335,7 +335,7 @@ list
<term> <varname>process</varname> </term>
<listitem>
<para>This is the filename of the executable to be started.
If not defined, then <command>bind10</command> will
If not defined, then <command>b10-init</command> will
use the component name instead.
</para>
</listitem>
......@@ -368,9 +368,8 @@ xfrin
<!-- TODO: formating -->
<para>
The <varname>Boss</varname> configuration commands are:
The <varname>init</varname> configuration commands are:
</para>
<!-- TODO: let's just let bind10 be known as bind10 and not Boss -->
<!-- TODO -->
<!--
......@@ -389,7 +388,7 @@ xfrin
-->
<para>
<command>getstats</command> tells <command>bind10</command>
<command>getstats</command> tells <command>b10-init</command>
to send its statistics data to the <command>b10-stats</command>
daemon.
This is an internal command and not exposed to the administrator.
......@@ -398,13 +397,13 @@ xfrin
<para>
<command>ping</command> is used to check the connection with the
<command>bind10</command> daemon.
<command>b10-init</command> daemon.
It returns the text <quote>pong</quote>.
</para>
<para>
<command>show_processes</command> lists the current processes
managed by <command>bind10</command>.
managed by <command>b10-init</command>.
The output is an array in JSON format containing the process
ID, the name for each and the address name used on each message bus.
<!-- TODO: what is name? -->
......@@ -413,10 +412,10 @@ xfrin
</para>
<para>
<command>shutdown</command> tells <command>bind10</command>
<command>shutdown</command> tells <command>b10-init</command>
to shutdown the BIND 10 servers.
It will tell each process it manages to shutdown and, when
complete, <command>bind10</command> will exit.
complete, <command>b10-init</command> will exit.
</para>
</refsect1>
......@@ -434,7 +433,7 @@ xfrin
<varlistentry>
<term>boot_time</term>
<listitem><para>
The date and time that the <command>bind10</command>
The date and time that the <command>b10-init</command>
process started.
This is represented in ISO 8601 format.
</para></listitem>
......@@ -493,14 +492,14 @@ xfrin
</citerefentry>, -->
<refsect1 id='history'><title>HISTORY</title>
<para>The development of <command>bind10</command>
<para>The development of <command>b10-init</command>
was started in October 2009.</para>
</refsect1>
<refsect1>
<title>AUTHORS</title>
<para>
The <command>bind10</command>
The <command>b10-init</command>
daemon was initially designed by Shane Kerr of ISC.
</para>
</refsect1>
......
#!/bin/sh
BIND10_SBIN_DIR=`dirname $0`
exec ${BIND10_SBIN_DIR}/b10-init $*
......@@ -25,7 +25,7 @@ It seems we are stuck with current msgq for a while and there's a chance the
new replacement will not be able to send sockets inbound. So, we need another
channel.
The boss will create a unix-domain socket and listen on it. When something
b10-init will create a unix-domain socket and listen on it. When something
requests a socket over the command channel and the socket is created, some kind
of token is returned to the application (which will represent the future
socket). The application then connects to the unix-domain socket, sends the
......@@ -60,7 +60,7 @@ command channel), the reference count can be decreased without problems. But
when the application terminates or crashes, we need to decrease it as well.
There's a problem, since we don't know which command channel connection (eg.
lname) belongs to which PID. Furthermore, the applications don't need to be
started by boss.
started by b10-init.
There are two possibilities:
* Let the msgq send messages about disconnected clients (eg. group message to
......@@ -75,12 +75,12 @@ There are two possibilities:
The commands
------------
* Command to release a socket. This one would have single parameter, the token
used to get the socket. After this, boss would decrease its reference count
and if it drops to zero, close its own copy of the socket. This should be used
when the module stops using the socket (and after closes it). The
library could remember the file-descriptor to token mapping (for
common applications that don't request the same socket multiple
times in parallel).
used to get the socket. After this, b10-init would decrease its reference
count and if it drops to zero, close its own copy of the socket. This
should be used when the module stops using the socket (and after closes
it). The library could remember the file-descriptor to token mapping (for
common applications that don't request the same socket multiple times in
parallel).
* Command to request a socket. It would have parameters to specify which socket
(IP address, address family, port) and how to allow sharing. Sharing would be
one of:
......
{
"module_spec": {
"module_name": "Boss",
"module_name": "Init",
"module_description": "Master process",
"config_data": [
{
......@@ -66,7 +66,7 @@
},
{
"command_name": "ping",
"command_description": "Ping the boss process",
"command_description": "Ping the b10-init process",
"command_args": []
},
{
......
......@@ -16,12 +16,12 @@
# of the xfrin messages python module.
% BIND10_CHECK_MSGQ_ALREADY_RUNNING checking if msgq is already running
The boss process is starting up and will now check if the message bus
The b10-init process is starting up and will now check if the message bus
daemon is already running. If so, it will not be able to start, as it
needs a dedicated message bus.
% BIND10_COMPONENT_FAILED component %1 (pid %2) failed: %3
The process terminated, but the bind10 boss didn't expect it to, which means
The process terminated, but b10-init didn't expect it to, which means
it must have failed.
% BIND10_COMPONENT_RESTART component %1 is about to restart
......@@ -30,7 +30,7 @@ as flawless service as possible, but it should be investigated what happened,
as it could happen again.
% BIND10_COMPONENT_START component %1 is starting
The named component is about to be started by the boss process.
The named component is about to be started by the b10-init process.
% BIND10_COMPONENT_START_EXCEPTION component %1 failed to start: %2
An exception (mentioned in the message) happened during the startup of the
......@@ -38,7 +38,7 @@ named component. The componet is not considered started and further actions
will be taken about it.
% BIND10_COMPONENT_STOP component %1 is being stopped
A component is about to be asked to stop willingly by the boss.
A component is about to be asked to stop willingly by the b10-init.
% BIND10_COMPONENT_UNSATISFIED component %1 is required to run and failed
A component failed for some reason (see previous messages). It is either a core
......@@ -59,31 +59,31 @@ will be propagated.
A different configuration of which components should be running is being
installed. All components that are no longer needed will be stopped and
newly introduced ones started. This happens at startup, when the configuration
is read the first time, or when an operator changes configuration of the boss.
is read the first time, or when an operator changes configuration of the b10-init.
% BIND10_CONFIGURATOR_RUN running plan of %1 tasks
A debug message. The configurator is about to execute a plan of actions it
computed previously.
% BIND10_CONFIGURATOR_START bind10 component configurator is starting up
The part that cares about starting and stopping the right component from the
boss process is starting up. This happens only once at the startup of the
boss process. It will start the basic set of processes now (the ones boss
needs to read the configuration), the rest will be started after the
configuration is known.
The part that cares about starting and stopping the right component from
the b10-init process is starting up. This happens only once at the startup
of the b10-init process. It will start the basic set of processes now (the
ones b10-init needs to read the configuration), the rest will be started
after the configuration is known.
% BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down
The part that cares about starting and stopping processes in the boss is
The part that cares about starting and stopping processes in the b10-init is
shutting down. All started components will be shut down now (more precisely,
asked to terminate by their own, if they fail to comply, other parts of
the boss process will try to force them).
the b10-init process will try to force them).
% BIND10_CONFIGURATOR_TASK performing task %1 on %2
A debug message. The configurator is about to perform one task of the plan it
is currently executing on the named component.
% BIND10_CONNECTING_TO_CC_FAIL failed to connect to configuration/command channel; try -v to see output from msgq
The boss process tried to connect to the communication channel for
The b10-init process tried to connect to the communication channel for
commands and configuration updates during initialization, but it
failed. This is a fatal startup error, and process will soon
terminate after some cleanup. There can be several reasons for the
......@@ -98,15 +98,15 @@ you specify the -u option to change process users, the directory must
be writable for that user.
% BIND10_INVALID_STATISTICS_DATA invalid specification of statistics data specified
An error was encountered when the boss module specified