[CalendarServer-changes] [6598] CalendarServer/branches/users/glyph/dont-start-postgres/ calendarserver/tap/caldav.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 10 18:54:10 PST 2010
Revision: 6598
http://trac.macosforge.org/projects/calendarserver/changeset/6598
Author: glyph at apple.com
Date: 2010-11-10 18:54:07 -0800 (Wed, 10 Nov 2010)
Log Message:
-----------
Move all application subprocess launching into a separate function.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py
Modified: CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py 2010-11-11 02:53:50 UTC (rev 6597)
+++ CalendarServer/branches/users/glyph/dont-start-postgres/calendarserver/tap/caldav.py 2010-11-11 02:54:07 UTC (rev 6598)
@@ -914,6 +914,34 @@
inheritFDs=inheritFDs, inheritSSLFDs=inheritSSLFDs
)
+
+ stats = CalDAVStatisticsServer(logger)
+ statsService = GroupOwnedUNIXServer(
+ gid, config.GlobalStatsSocket, stats, mode=0440
+ )
+ statsService.setName("stats")
+ statsService.setServiceParent(s)
+
+ return s
+
+
+ def addSlaveProcesses(self, monitor, dispenser, dispatcher, configPath,
+ inheritFDs=None, inheritSSLFDs=None):
+ for slaveNumber in xrange(0, config.MultiProcess.ProcessCount):
+ if config.UseMetaFD:
+ extraArgs = dict(metaSocket=dispatcher.addSocket())
+ else:
+ extraArgs = dict(inheritFDs=inheritFDs,
+ inheritSSLFDs=inheritSSLFDs)
+ if dispenser is not None:
+ extraArgs.update(ampSQLDispenser=dispenser)
+ process = TwistdSlaveProcess(
+ sys.argv[0], self.tapname, configPath, slaveNumber,
+ config.BindAddresses, **extraArgs
+ )
+ monitor.addProcessObject(process, PARENT_ENVIRONMENT)
+
+
if (
config.Notifications.Enabled and
config.Notifications.InternalNotificationHost == "localhost"
@@ -931,7 +959,7 @@
notificationsArgv.extend((
"--reactor=%s" % (config.Twisted.reactor,),
"-n", self.notifierTapName,
- "-f", options["config"],
+ "-f", configPath,
))
monitor.addProcess("notifications", notificationsArgv,
env=PARENT_ENVIRONMENT)
@@ -953,7 +981,7 @@
mailGatewayArgv.extend((
"--reactor=%s" % (config.Twisted.reactor,),
"-n", self.mailGatewayTapName,
- "-f", options["config"],
+ "-f", configPath,
))
monitor.addProcess("mailgateway", mailGatewayArgv,
@@ -971,39 +999,13 @@
taskArgv.extend((
"--reactor=%s" % (config.Twisted.reactor,),
"-n", "caldav_task",
- "-f", options["config"],
+ "-f", configPath,
))
monitor.addProcess("caldav_task", taskArgv, env=PARENT_ENVIRONMENT)
- stats = CalDAVStatisticsServer(logger)
- statsService = GroupOwnedUNIXServer(
- gid, config.GlobalStatsSocket, stats, mode=0440
- )
- statsService.setName("stats")
- statsService.setServiceParent(s)
- return s
-
-
- def addSlaveProcesses(self, monitor, dispenser, dispatcher, configPath,
- inheritFDs=None, inheritSSLFDs=None):
- for slaveNumber in xrange(0, config.MultiProcess.ProcessCount):
- if config.UseMetaFD:
- extraArgs = dict(metaSocket=dispatcher.addSocket())
- else:
- extraArgs = dict(inheritFDs=inheritFDs,
- inheritSSLFDs=inheritSSLFDs)
- if dispenser is not None:
- extraArgs.update(ampSQLDispenser=dispenser)
- process = TwistdSlaveProcess(
- sys.argv[0], self.tapname, configPath, slaveNumber,
- config.BindAddresses, **extraArgs
- )
- monitor.addProcessObject(process, PARENT_ENVIRONMENT)
-
-
def deleteStaleSocketFiles(self):
# Check all socket files we use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101110/6add6377/attachment-0001.html>
More information about the calendarserver-changes
mailing list