[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Added method so that SrvDaemon can be run in the foreground without all the



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 3a544c04cc6171f857ffea93ca4aefc7a51c7d46
# Parent  d7b91e64bd4c84e9d123ed8efe45544a7a4fd667
Added method so that SrvDaemon can be run in the foreground without all the
forking implied by the start method.  This makes it easier to run valgrind
against Xend, or run it with a pydebug-compiled Python.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r d7b91e64bd4c -r 3a544c04cc61 tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 21 11:42:47 2005
+++ b/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 21 11:44:43 2005
@@ -300,3 +300,25 @@
     except:
         inst = Daemon()
     return inst
+
+
+def main(argv = None):
+    global XEND_DAEMONIZE
+    
+    XEND_DAEMONIZE = 0
+    if argv is None:
+        argv = sys.argv
+
+    try:
+        daemon = instance()
+    
+        r,w = os.pipe()
+        daemon.run(os.fdopen(w, 'w'))
+        return 0
+    except Exception, exn:
+        log.fatal(exn)
+        return 1
+
+
+if __name__ == "__main__":
+    sys.exit(main())

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.