def daemonize( suite, port ): """ ATTRIBUTION: base on a public domain code recipe by Jurgen Hermann: http://code.activestate.com/recipes/66012-fork-a-daemon-process-on-unix/ """ # Do the UNIX double-fork magic, see Stevens' "Advanced # Programming in the UNIX Environment" for details (ISBN 0201563177) sout = suite_output( suite ) try: mkdir_p( sout.get_dir() ) except Exception, x: sys.exit( str(x) )
def daemonize(suite, port): """ ATTRIBUTION: base on a public domain code recipe by Jurgen Hermann: http://code.activestate.com/recipes/66012-fork-a-daemon-process-on-unix/ """ # Do the UNIX double-fork magic, see Stevens' "Advanced # Programming in the UNIX Environment" for details (ISBN 0201563177) sout = suite_output(suite) try: pid = os.fork() if pid > 0: # exit first parent sys.exit(0) except OSError, e: print >> sys.stderr, "fork #1 failed: %d (%s)" % (e.errno, e.strerror) sys.exit(1)
def daemonize(suite, port): """ ATTRIBUTION: base on a public domain code recipe by Jurgen Hermann: http://code.activestate.com/recipes/66012-fork-a-daemon-process-on-unix/ """ # Do the UNIX double-fork magic, see Stevens' "Advanced # Programming in the UNIX Environment" for details (ISBN 0201563177) sout = suite_output(suite) try: pid = os.fork() if pid > 0: # exit first parent sys.exit(0) except OSError, e: print >> sys.stderr, "fork #1 failed: %d (%s)" % (e.errno, e.strerror) sys.exit(1)