BIND 10 trac565, updated. 841627853b192480a8e663870ad3a1cb39bb724e [trac565] Log shutdowns
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Feb 14 17:36:37 UTC 2011
The branch, trac565 has been updated
via 841627853b192480a8e663870ad3a1cb39bb724e (commit)
via 26aae7d612bf0f01b22a7c4784fffb909d148970 (commit)
from 5266058997a5746c04db5a721ac60630bbbc2abd (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 841627853b192480a8e663870ad3a1cb39bb724e
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Feb 14 18:35:01 2011 +0100
[trac565] Log shutdowns
commit 26aae7d612bf0f01b22a7c4784fffb909d148970
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Feb 14 17:18:28 2011 +0100
[trac565] Allow stopping of processes
It has no tests, I have an idea how to test it, but it is a lot of work
and I'm going to create a task for it.
It needs some logging.
Used by config_handle currently (introduced in this branch). It allows
starting and stopping auth and resolver at runtime by configuration.
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/bind10.py.in | 38 ++++++++++++++++++++++++++++++++++----
1 files changed, 34 insertions(+), 4 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/bind10.py.in b/src/bin/bind10/bind10.py.in
index e08bf1e..36a8006 100644
--- a/src/bin/bind10/bind10.py.in
+++ b/src/bin/bind10/bind10.py.in
@@ -222,6 +222,7 @@ class BoB:
self.msgq_socket_file = msgq_socket_file
self.nocache = nocache
self.processes = {}
+ self.expected_shutdowns = {}
self.runnable = False
self.uid = setuid
self.username = username
@@ -601,10 +602,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
+ def stop_process(self, process, sendto):
+ """
+ Stop the given process, friendly-like. The process is the name it has
+ (in logs, etc), the second is the address on msgq.
+ """
+ if self.verbose:
+ sys.stdout.write("[bind10] Asking %s to terminate\n" % process)
+ # TODO: Some timeout to solve processes that don't want to die would
+ # help. We can even store it in the dict, it is used only as a set
+ self.expected_shutdowns[process] = 1
+ # Ask the process to die willingly
+ self.cc_session.group_sendmsg({'command': ['shutdown']}, sendto,
+ sendto)
+
+ # Series of stop_process wrappers
+ def stop_resolver(self):
+ self.stop_process('b10-resolver', 'Resolver')
+
+ def stop_auth(self):
+ self.stop_process('b10-auth', 'Auth')
+
+ def stop_xfrout(self):
+ self.stop_process('b10-xfrout', 'Xfrout')
+
+ def stop_xfrin(self):
+ self.stop_process('b10-xfrin', 'Xfrin')
+
+ def stop_zonemgr(self):
+ self.stop_process('b10-zonemgr', 'Zonemgr')
def shutdown(self):
"""Stop the BoB instance."""
@@ -710,6 +736,10 @@ class BoB:
still_dead = {}
now = time.time()
for proc_info in self.dead_processes.values():
+ if proc_info.name in self.expected_shutdowns:
+ # We don't restart, we wanted it to die
+ del self.expected_shutdowns[proc_info.name]
+ continue
restart_time = proc_info.restart_schedule.get_restart_time(now)
if restart_time > now:
if (next_restart is None) or (next_restart > restart_time):
More information about the bind10-changes
mailing list