[Zope-Checkins] CVS: ZODB3/zdaemon - sample.conf:1.6 schema.xml:1.7 zdoptions.py:1.10 zdrun.py:1.9
Guido van Rossum
guido@python.org
Thu, 23 Jan 2003 12:29:05 -0500
Update of /cvs-repository/ZODB3/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv16822
Modified Files:
sample.conf schema.xml zdoptions.py zdrun.py
Log Message:
Add a "hang-around" option, to control whether the zdrun process keeps
hanging around once the subprocess has exited (and we're not
interested in restarting it). It defaults to false. The old behavior
can be gotten by setting it to true. There's no command line option
for this.
=== ZODB3/zdaemon/sample.conf 1.5 => 1.6 ===
--- ZODB3/zdaemon/sample.conf:1.5 Wed Jan 22 16:22:56 2003
+++ ZODB3/zdaemon/sample.conf Thu Jan 23 12:29:01 2003
@@ -12,6 +12,7 @@
# user has no default
directory /
default-to-interactive True
+ hang-around False
</runner>
<eventlog>
=== ZODB3/zdaemon/schema.xml 1.6 => 1.7 ===
--- ZODB3/zdaemon/schema.xml:1.6 Wed Jan 22 16:22:56 2003
+++ ZODB3/zdaemon/schema.xml Thu Jan 23 12:29:01 2003
@@ -19,6 +19,7 @@
<key name="user" datatype="string" />
<key name="directory" datatype="existing-directory" default="/" />
<key name="default-to-interactive" datatype="boolean" default="true" />
+ <key name="hang-around" datatype="boolean" default="false" />
</sectiontype>
<section name="*" type="runner" attribute="runner" required="yes" />
=== ZODB3/zdaemon/zdoptions.py 1.9 => 1.10 ===
--- ZODB3/zdaemon/zdoptions.py:1.9 Wed Jan 22 16:22:56 2003
+++ ZODB3/zdaemon/zdoptions.py Thu Jan 23 12:29:01 2003
@@ -289,6 +289,7 @@
self.add("user", "runner.user", "u:", "user=")
self.add("directory", "runner.directory", "z:", "directory=",
ZConfig.datatypes.existing_directory, default="/")
+ self.add("hang_around", "runner.hang_around")
# ZConfig datatype
=== ZODB3/zdaemon/zdrun.py 1.8 => 1.9 ===
--- ZODB3/zdaemon/zdrun.py:1.8 Wed Jan 22 18:21:37 2003
+++ ZODB3/zdaemon/zdrun.py Thu Jan 23 12:29:01 2003
@@ -350,7 +350,8 @@
def runforever(self):
info("daemon manager started")
- while self.mood >= 0 or self.proc.pid:
+ min_mood = not self.options.hang_around
+ while self.mood >= min_mood or self.proc.pid:
if self.mood > 0 and not self.proc.pid and not self.delay:
pid = self.proc.spawn()
if not pid: