[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - zopectl.py:1.5
Chris McDonough
chrism@zope.com
Mon, 14 Jul 2003 01:06:46 -0400
Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv24940
Modified Files:
zopectl.py
Log Message:
Default to zdrun daemon status "on" (effectively prevents signals from reaching child processes). This will prevent the symptom of killing the server when pressing ctrl-C from an interactive logtail.
Also ignore child process return statuses. If we don't, an interactive zopectl shell can clutter up the process table with zombies after a few starts and stops.
=== Zope/lib/python/Zope/Startup/zopectl.py 1.4 => 1.5 ===
--- Zope/lib/python/Zope/Startup/zopectl.py:1.4 Mon Jul 7 00:19:46 2003
+++ Zope/lib/python/Zope/Startup/zopectl.py Mon Jul 14 01:06:41 2003
@@ -35,6 +35,7 @@
import os
import sys
+import signal
import zdaemon
import Zope.Startup
@@ -66,7 +67,7 @@
ZDOptions.__init__(self)
self.add("backofflimit", "runner.backoff_limit",
"b:", "backoff-limit=", int, default=10)
- self.add("daemon", "runner.daemon", "d", "daemon", flag=1, default=0)
+ self.add("daemon", "runner.daemon", "d", "daemon", flag=1, default=1)
self.add("forever", "runner.forever", "f", "forever",
flag=1, default=0)
self.add("hang_around", "runner.hang_around", default=0)
@@ -179,6 +180,9 @@
c.do_status()
c.cmdloop()
-
if __name__ == "__main__":
+ # we don't care to be notified of our childrens' exit statuses.
+ # this prevents zombie processes from cluttering up the process
+ # table when zopectl start/stop is used interactively.
+ signal.signal(signal.SIGCHLD, signal.SIG_IGN)
main()