ia64/xen-unstable

changeset 9903:a19cc748469e

Debugging Xend with XEND_DAEMONIZE set to False doesn't work as
expected. Xend actually creates two children and the XEND_DAEMONIZE
flag only prevents one of the children from being created. This
patch causes none of the children to be created. With this patch,
Xend functionality is performed in the process executed from the
command line (i.e., /usr/sbin/xend). This patch makes it possible to
debug Xend with pdb.

Signed-off-by: Randy Thelen <rthelen@netapp.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Apr 30 09:52:59 2006 +0100 (2006-04-30)
parents 63e29ff50fe6
children 7997d8f16240
files tools/python/xen/xend/server/SrvDaemon.py
line diff
     1.1 --- a/tools/python/xen/xend/server/SrvDaemon.py	Sun Apr 30 09:52:13 2006 +0100
     1.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py	Sun Apr 30 09:52:59 2006 +0100
     1.3 @@ -87,8 +87,6 @@ class Daemon:
     1.4  
     1.5  
     1.6      def daemonize(self):
     1.7 -        if not XEND_DAEMONIZE: return
     1.8 - 
     1.9          # Detach from TTY.
    1.10  
    1.11          # Become the group leader (already a child process)
    1.12 @@ -133,6 +131,13 @@ class Daemon:
    1.13  
    1.14          ret = 0
    1.15  
    1.16 +        # If we're not going to create a daemon, simply
    1.17 +        # call the run method right here.
    1.18 +        if not XEND_DAEMONIZE:
    1.19 +            self.tracing(trace)
    1.20 +            self.run(None)
    1.21 +            return ret;
    1.22 +        
    1.23          # we use a pipe to communicate between the parent and the child process
    1.24          # this way we know when the child has actually initialized itself so
    1.25          # we can avoid a race condition during startup