[CalendarServer-changes] [962]
CalendarServer/branches/users/dreid/cluster-2
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jan 8 09:22:20 PST 2007
Revision: 962
http://trac.macosforge.org/projects/calendarserver/changeset/962
Author: dreid at apple.com
Date: 2007-01-08 09:22:20 -0800 (Mon, 08 Jan 2007)
Log Message:
-----------
Install runner with the apple makefile, and pass environment of parent process to child processes explicitly, (for some reason this is needed when using ./run -t multiprocess)
Modified Paths:
--------------
CalendarServer/branches/users/dreid/cluster-2/support/Makefile.Apple
CalendarServer/branches/users/dreid/cluster-2/twistedcaldav/cluster.py
Added Paths:
-----------
CalendarServer/branches/users/dreid/cluster-2/lib-patches/Twisted/twisted.runner.procmon.patch
Added: CalendarServer/branches/users/dreid/cluster-2/lib-patches/Twisted/twisted.runner.procmon.patch
===================================================================
--- CalendarServer/branches/users/dreid/cluster-2/lib-patches/Twisted/twisted.runner.procmon.patch (rev 0)
+++ CalendarServer/branches/users/dreid/cluster-2/lib-patches/Twisted/twisted.runner.procmon.patch 2007-01-08 17:22:20 UTC (rev 962)
@@ -0,0 +1,29 @@
+Index: twisted/runner/procmon.py
+===================================================================
+--- twisted/runner/procmon.py (revision 18545)
++++ twisted/runner/procmon.py (working copy)
+@@ -130,10 +130,10 @@
+ self.consistency = reactor.callLater(self.consistencyDelay,
+ self._checkConsistency)
+
+- def addProcess(self, name, args, uid=None, gid=None):
++ def addProcess(self, name, args, uid=None, gid=None, env={}):
+ if self.processes.has_key(name):
+ raise KeyError("remove %s first" % name)
+- self.processes[name] = args, uid, gid
++ self.processes[name] = args, uid, gid, env
+ if self.active:
+ self.startProcess(name)
+
+@@ -175,9 +175,9 @@
+ p = self.protocols[name] = LoggingProtocol()
+ p.service = self
+ p.name = name
+- args, uid, gid = self.processes[name]
++ args, uid, gid, env = self.processes[name]
+ self.timeStarted[name] = time.time()
+- reactor.spawnProcess(p, args[0], args, uid=uid, gid=gid)
++ reactor.spawnProcess(p, args[0], args, uid=uid, gid=gid, env=env)
+
+ def _forceStopProcess(self, proc):
+ try:
Modified: CalendarServer/branches/users/dreid/cluster-2/support/Makefile.Apple
===================================================================
--- CalendarServer/branches/users/dreid/cluster-2/support/Makefile.Apple 2007-01-08 17:15:57 UTC (rev 961)
+++ CalendarServer/branches/users/dreid/cluster-2/support/Makefile.Apple 2007-01-08 17:22:20 UTC (rev 962)
@@ -63,6 +63,7 @@
Twisted::
@echo "Building Twisted..."
$(_v) cd $(BuildDirectory)/Twisted && $(Environment) $(PYTHON) twisted/topfiles/setup.py install $(PY_INSTALL_FLAGS)
+ $(_v) cd $(BuildDirectory)/Twisted && $(Environment) $(PYTHON) twisted/runner/topfiles/setup.py build
$(_v) cd $(BuildDirectory)/Twisted && $(TwistedSubEnvironment) $(PYTHON) twisted/web/topfiles/setup.py build
$(_v) cd $(BuildDirectory)/Twisted && $(TwistedSubEnvironment) $(PYTHON) twisted/web2/topfiles/setup.py build
Modified: CalendarServer/branches/users/dreid/cluster-2/twistedcaldav/cluster.py
===================================================================
--- CalendarServer/branches/users/dreid/cluster-2/twistedcaldav/cluster.py 2007-01-08 17:15:57 UTC (rev 961)
+++ CalendarServer/branches/users/dreid/cluster-2/twistedcaldav/cluster.py 2007-01-08 17:22:20 UTC (rev 962)
@@ -1,3 +1,21 @@
+##
+# Copyright (c) 2005-2006 Apple Computer, Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# DRI: David Reid, dreid at apple.com
+##
+
import os
import sys
import tempfile
@@ -73,6 +91,8 @@
def makeService_multiprocess(self, options):
service = procmon.ProcessMonitor()
+
+ parentEnv = {'PYTHONPATH': os.environ.get('PYTHONPATH', ''),}
hosts = []
sslHosts = []
@@ -97,7 +117,8 @@
service.addProcess(process.getName(),
process.getCommandLine(),
uid=options.parent['uid'],
- gid=options.parent['gid'])
+ gid=options.parent['gid'],
+ env=parentEnv)
if not config.SSLOnly:
hosts.append(process.getHostLine())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070108/af5c6854/attachment.html
More information about the calendarserver-changes
mailing list