[svn] commit: r3814 - /branches/trac229/src/bin/bind10/bind10.py.in
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Dec 13 15:17:40 UTC 2010
Author: stephen
Date: Mon Dec 13 15:17:40 2010
New Revision: 3814
Log:
Ensure that process started and process terminated messages are output
regardless of the state of the verbose flag.
Modified:
branches/trac229/src/bin/bind10/bind10.py.in
Modified: branches/trac229/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/trac229/src/bin/bind10/bind10.py.in (original)
+++ branches/trac229/src/bin/bind10/bind10.py.in Mon Dec 13 15:17:40 2010
@@ -612,27 +612,44 @@
raise
if pid == 0: break
if pid in self.processes:
+
+ # One of the processes we know about. Get information on it.
proc_info = self.processes.pop(pid)
proc_info.restart_schedule.set_run_stop_time()
self.dead_processes[proc_info.pid] = proc_info
- if self.verbose:
- sys.stdout.write("[bind10] Process %s (PID %d) died.\n" %
- (proc_info.name, proc_info.pid))
- if proc_info.name == "b10-msgq":
- if self.verbose and self.runnable:
+
+ # Write out message, but only if in the running state:
+ # During startup and shutdown, these messages are handled
+ # elsewhere.
+ if self.runnable:
+ if exit_status is None:
+ sys.stdout.write(
+ "[bind10] Process %s (PID %d) died: exit status not available" %
+ (proc_info.name, proc_info.pid))
+ else:
+ sys.stdout.write(
+ "[bind10] Process %s (PID %d) terminated, exit status = %d\n" %
+ (proc_info.name, proc_info.pid, exit_status))
+
+ # Was it a special process?
+ if proc_info.name == "b10-msgq":
sys.stdout.write(
"[bind10] The b10-msgq process died, shutting down.\n")
- self.runnable = False
+ self.runnable = False
else:
sys.stdout.write("[bind10] Unknown child pid %d exited.\n" % pid)
def restart_processes(self):
- """Restart any dead processes.
- Returns the time when the next process is ready to be restarted.
- If the server is shutting down, returns 0.
- If there are no processes, returns None.
- The values returned can be safely passed into select() as the
- timeout value."""
+ """
+ Restart any dead processes:
+
+ * Returns the time when the next process is ready to be restarted.
+ * If the server is shutting down, returns 0.
+ * If there are no processes, returns None.
+
+ The values returned can be safely passed into select() as the
+ timeout value.
+ """
next_restart = None
# if we're shutting down, then don't restart
if not self.runnable:
@@ -649,13 +666,12 @@
else:
if self.verbose:
sys.stdout.write("[bind10] Resurrecting dead %s process...\n" %
- proc_info.name)
+ proc_info.name)
try:
proc_info.respawn()
self.processes[proc_info.pid] = proc_info
- if self.verbose:
- sys.stdout.write("[bind10] Resurrected %s (PID %d)\n" %
- (proc_info.name, proc_info.pid))
+ sys.stdout.write("[bind10] Resurrected %s (PID %d)\n" %
+ (proc_info.name, proc_info.pid))
except:
still_dead[proc_info.pid] = proc_info
# remember any processes that refuse to be resurrected
More information about the bind10-changes
mailing list