def start(): handleUserDefinedSignals(childWaitSigHandler) print "forking ..." pid=os.fork() print "IBSng started with pid=%d"%pid if pid == 0: try: try: mainThreadInitialize() os.kill(os.getppid(),signal.SIGUSR1) except: print "Shutting down on error" os.kill(os.getppid(),signal.SIGUSR2) raise except: err_text=ibs_exceptions.getExceptionText() print err_text logToSysLog(err_text) core.main.mainThreadShutdown() print "Successfully initialized, entering event loop ..." event.startLoop() else: signal.pause()
def start(): handleUserDefinedSignals(childWaitSigHandler) print "forking ..." pid = os.fork() print "IBSng started with pid=%d" % pid if pid == 0: try: try: mainThreadInitialize() os.kill(os.getppid(), signal.SIGUSR1) except: print "Shutting down on error" os.kill(os.getppid(), signal.SIGUSR2) raise except: err_text = ibs_exceptions.getExceptionText() sys.stderr.write(err_text) logToSysLog(err_text) core.main.mainThreadShutdown() print "Successfully initialized, entering event loop ..." writePID(os.getpid()) sys.setcheckinterval(500) event.startLoop() else: signal.pause()
def debug(): try: mainThreadInitialize() except: print "Shutting down on error" raise print "Successfully initialized, entering event loop ..." event.startLoop()