[Zodb-checkins] CVS: ZODB3/zdaemon - zdrun.py:1.13.16.2 zdctl.py:1.43.14.1

Jeremy Hylton jeremy at zope.com
Mon Sep 15 14:03:27 EDT 2003


Update of /cvs-repository/ZODB3/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv13599/zdaemon

Modified Files:
      Tag: Zope-2_7-branch
	zdrun.py zdctl.py 
Log Message:
Take two: Merge changes from ZODB3-3_2-branch to Zope-2_7-branch.

Please make all future changes on the Zope-2_7-branch instead.

The previous attempt used "cvs up -j ZODB3-3_2-branch", but appeared
to get only a small fraction of the changes.  This attempt is based on
copying a checkout of ZODB3-3_2-branch over top of a checkout of
Zope-2_7-branch.


=== ZODB3/zdaemon/zdrun.py 1.13.16.1 => 1.13.16.2 ===
--- ZODB3/zdaemon/zdrun.py:1.13.16.1	Mon Jul 21 12:38:38 2003
+++ ZODB3/zdaemon/zdrun.py	Mon Sep 15 14:02:55 2003
@@ -317,28 +317,6 @@
             self.waitstatus = pid, sts
 
     def daemonize(self):
-
-        # To daemonize, we need to become the leader of our own session
-        # (process) group.  If we do not, signals sent to our
-        # parent process will also be sent to us.   This might be bad because
-        # signals such as SIGINT can be sent to our parent process during
-        # normal (uninteresting) operations such as when we press Ctrl-C in the
-        # parent terminal window to escape from a logtail command.
-        # To disassociate ourselves from our parent's session group we use
-        # os.setsid.  It means "set session id", which has the effect of
-        # disassociating a process from is current session and process group
-        # and setting itself up as a new session leader.
-        #
-        # Unfortunately we cannot call setsid if we're already a session group
-        # leader, so we use "fork" to make a copy of ourselves that is
-        # guaranteed to not be a session group leader.
-        #
-        # We also change directories, set stderr and stdout to null, and
-        # change our umask.
-        #
-        # This explanation was (gratefully) garnered from
-        # http://www.hawklord.uklinux.net/system/daemons/d3.htm
-
         pid = os.fork()
         if pid != 0:
             # Parent
@@ -711,9 +689,9 @@
     return path
 
 # Main program
+
 def main(args=None):
     assert os.name == "posix", "This code makes many Unix-specific assumptions"
-
     zLOG.initialize()
     d = Daemonizer()
     d.main(args)


=== ZODB3/zdaemon/zdctl.py 1.43 => 1.43.14.1 ===
--- ZODB3/zdaemon/zdctl.py:1.43	Tue Mar 11 17:46:58 2003
+++ ZODB3/zdaemon/zdctl.py	Mon Sep 15 14:02:55 2003
@@ -42,11 +42,6 @@
 
 from __future__ import nested_scopes
 
-# XXX Related code lives in lib/python/Zope/Startup/ZctlLib.py on the
-# 'chrism-install-branch' branch.
-# The code there knows more about Zope and about Windows, but doesn't
-# use zdaemon.py or ZConfig.
-
 import os
 import re
 import cmd
@@ -87,7 +82,7 @@
         self.add("logfile", "runner.logfile", "l:", "logfile=")
         self.add("python", "runner.python")
         self.add("zdrun", "runner.zdrun")
-        self.add("prompt", "runner.prompt")
+        self.add("prompt", "runner.prompt", default="zdctl>")
 
     def realize(self, *args, **kwds):
         RunnerOptions.realize(self, *args, **kwds)




More information about the Zodb-checkins mailing list