Exemplo n.º 1
0
    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.")
Exemplo n.º 2
0
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.")
Exemplo n.º 3
0
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.")
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
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.")
Exemplo n.º 7
0
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.")
Exemplo n.º 8
0
 def opt_reactor(self, reactorName):
     # this must happen before parseArgs does lots of imports
     app.installReactor(reactorName)
     print "Using %s reactor" % app.reactorTypes[reactorName]
Exemplo n.º 9
0
 def opt_reactor(self, reactorName):
     app.installReactor(reactorName)
     print "Using %s reactor" % app.reactorTypes[reactorName]
Exemplo n.º 10
0
 def opt_reactor(self, reactorName):
     # this must happen before parseArgs does lots of imports
     app.installReactor(reactorName)
     print "Using %s reactor" % app.reactorTypes[reactorName]