def postOptions(self): # This does not invoke the super implementation. At the time this # method was implemented, all the super method did was *conditionally* # set self['no_save'] to True and take the abspath of self['pidfile']. # See below for the irrelevance of those operations. app.installReactor(self['reactor']) self._fixConfig() self._checkPID() S = self.parent.getStore() # make sure we open it here oldstdout = sys.stdout oldstderr = sys.stderr self._startLogging() app.initialLog() self.application = application = self._constructApplication() self._startApplication() app.runReactorWithLogging(self, oldstdout, oldstderr) self._removePID() app.reportProfile(self['report-profile'], service.IProcess(application).processName) log.msg("Server Shut Down.")
def runApp(config): checkPID(config["pidfile"]) passphrase = app.getPassphrase(config["encrypted"]) app.installReactor(config["reactor"]) config["nodaemon"] = config["nodaemon"] or config["debug"] oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config["logfile"], config["syslog"], config["prefix"], config["nodaemon"]) app.initialLog() application = app.getApplication(config, passphrase) startApplication(config, application) app.runReactorWithLogging(config, oldstdout, oldstderr) removePID(config["pidfile"]) app.reportProfile(config["report-profile"], service.IProcess(application).processName) log.msg("Server Shut Down.")
def runApp(config): passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) application = app.getApplication(config, passphrase) oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile']) app.initialLog() os.chdir(config['rundir']) service.IService(application).privilegedStartService() app.startApplication(application, not config['no_save']) app.startApplication(internet.TimerService(0.1, lambda:None), 0) app.runReactorWithLogging(config, oldstdout, oldstderr) app.reportProfile(config['report-profile'], service.IProcess(application).processName) log.msg("Server Shut Down.")
def postOptions(self): app.installReactor(self['reactor']) self['no_save'] = True self['nodaemon'] = True if 'port' not in self: self['port'] = 8080 oldstdout = sys.stdout oldstderr = sys.stderr self._startLogging() self.suite = self._getSuite(self['testmodules']) self.application = self._constructApplication() self._startApplication() app.runReactorWithLogging(self, oldstdout, oldstderr)
def runApp(config): passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) application = app.getApplication(config, passphrase) oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile']) app.initialLog() os.chdir(config['rundir']) service.IService(application).privilegedStartService() app.startApplication(application, not config['no_save']) app.startApplication(internet.TimerService(0.1, lambda: None), 0) app.runReactorWithLogging(config, oldstdout, oldstderr) app.reportProfile(config['report-profile'], service.IProcess(application).processName) log.msg("Server Shut Down.")
def runApp(config): checkPID(config['pidfile']) passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) config['nodaemon'] = config['nodaemon'] or config['debug'] oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile'], config['syslog'], config['prefix'], config['nodaemon']) app.initialLog() application = app.getApplication(config, passphrase) startApplication(config, application) app.runReactorWithLogging(config, oldstdout, oldstderr) removePID(config['pidfile']) app.reportProfile(config['report-profile'], service.IProcess(application).processName) log.msg("Server Shut Down.")
def opt_reactor(self, reactorName): # this must happen before parseArgs does lots of imports app.installReactor(reactorName) print "Using %s reactor" % app.reactorTypes[reactorName]
def opt_reactor(self, reactorName): app.installReactor(reactorName) print "Using %s reactor" % app.reactorTypes[reactorName]