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@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-21 12:44:43 +01:00
1 parent 0858255f54
commit 8c4aff7e06
1 file changed
+22
+22
View File
@@ -300,3 +300,25 @@ def instance():
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())
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.