29
29
log.startLogging(logFile)
33
passphrase = app.getPassphrase(config['encrypted'])
34
app.installReactor(config['reactor'])
35
application = app.getApplication(config, passphrase)
36
oldstdout = sys.stdout
37
oldstderr = sys.stderr
38
startLogging(config['logfile'])
40
os.chdir(config['rundir'])
41
service.IService(application).privilegedStartService()
42
app.startApplication(application, not config['no_save'])
43
app.startApplication(internet.TimerService(0.1, lambda:None), 0)
44
app.runReactorWithLogging(config, oldstdout, oldstderr)
45
app.reportProfile(config['report-profile'],
46
service.IProcess(application).processName)
47
log.msg("Server Shut Down.")
51
app.run(runApp, ServerOptions)
34
class WindowsApplicationRunner(app.ApplicationRunner):
36
An ApplicationRunner which avoids unix-specific things. No
37
forking, no PID files, no privileges.
39
def preApplication(self):
41
Do pre-application-creation setup.
43
self.oldstdout = sys.stdout
44
self.oldstderr = sys.stderr
45
startLogging(self.config['logfile'])
47
os.chdir(self.config['rundir'])
50
def postApplication(self):
52
Start the application and run the reactor.
54
service.IService(self.application).privilegedStartService()
55
app.startApplication(self.application, not self.config['no_save'])
56
app.startApplication(internet.TimerService(0.1, lambda:None), 0)
57
app.runReactorWithLogging(self.config, self.oldstdout, self.oldstderr)
58
app.reportProfile(self.config['report-profile'],
59
service.IProcess(self.application).processName)
60
log.msg("Server Shut Down.")