[CalendarServer-changes] [1146] CalendarServer/branches/users/dreid/pid-removal-2

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 7 16:30:38 PST 2007


Revision: 1146
          http://trac.macosforge.org/projects/calendarserver/changeset/1146
Author:   dreid at apple.com
Date:     2007-02-07 16:30:38 -0800 (Wed, 07 Feb 2007)

Log Message:
-----------
Don't start children with uid and gid, tell the children to drop privileges so they can read the SSL keys.  Also make sure we start multiprocess by default and set the FileLogObserver timeFormat to '' so we don't get double dates in our log file.

Modified Paths:
--------------
    CalendarServer/branches/users/dreid/pid-removal-2/conf/caldavd.plist
    CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/cluster.py
    CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/tap.py

Modified: CalendarServer/branches/users/dreid/pid-removal-2/conf/caldavd.plist
===================================================================
--- CalendarServer/branches/users/dreid/pid-removal-2/conf/caldavd.plist	2007-02-07 18:59:37 UTC (rev 1145)
+++ CalendarServer/branches/users/dreid/pid-removal-2/conf/caldavd.plist	2007-02-08 00:30:38 UTC (rev 1146)
@@ -151,12 +151,12 @@
   <key>SudoersFile</key>
   <string>/etc/caldavd/sudoers.plist</string>
   <key>ServerType</key>
-  <string>singleprocess</string>
+  <string>multiprocess</string>
   
   <key>MultiProcess</key>
   <dict>
     <key>NumProcesses</key>
-    <integer>0</integer>
+    <integer>1</integer>
 
     <key>LoadBalancer</key>
     <dict>

Modified: CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/cluster.py
===================================================================
--- CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/cluster.py	2007-02-07 18:59:37 UTC (rev 1145)
+++ CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/cluster.py	2007-02-08 00:30:38 UTC (rev 1146)
@@ -65,13 +65,17 @@
     def getCommandLine(self):
         return [
             sys.executable,
-            self.twistd, '-n', 'caldav', 
+            self.twistd,
+            '-u', config.Username,
+            '-g', config.Groupname,
+            '-n', 'caldav',
             '-f', self.configFile,
-            '-o', 'ServerType=singleprocess',
+            '-o', 'ServerType=slave',
             '-o', 'BindAddress=%s' % (','.join(self.interfaces),),
             '-o', 'Port=%s' % (self.port,),
             '-o', 'SSLPort=%s' % (self.sslPort,),
-            '-o', 'PIDFile=None']
+            '-o', 'PIDFile=None',
+            '-o', 'ErrorLogFile=None']
     
     def getHostLine(self, ssl=None):
         name = self.getName()
@@ -111,14 +115,8 @@
                                      bindAddress,
                                      port, sslport)
 
-        uid, gid = None, None
-        if config.Username or config.Groupname:
-            uid, gid = getid(config.Username, config.Groupname)
-            
         service.addProcess(process.getName(),
                            process.getCommandLine(),
-                           uid=uid,
-                           gid=gid,
                            env=parentEnv)
         
         if not config.SSLOnly:

Modified: CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/tap.py
===================================================================
--- CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/tap.py	2007-02-07 18:59:37 UTC (rev 1145)
+++ CalendarServer/branches/users/dreid/pid-removal-2/twistedcaldav/tap.py	2007-02-08 00:30:38 UTC (rev 1146)
@@ -79,7 +79,7 @@
         ["config", "f", "/etc/caldavd/caldavd.plist",
          "Path to configuration file."],
         ]
-
+        
     zsh_actions = {"config" : "_files -g '*.plist'"}
 
     def __init__(self, *args, **kwargs):
@@ -160,6 +160,13 @@
             self.checkFile(config.SSLPrivateKey, "SSL Private key")
             self.checkFile(config.SSLCertificate, "SSL Public key")
 
+        #
+        # Nuke the file log observer's time format.
+        #
+
+        if not config.ErrorLogFile and config.ServerType == 'slave':
+            log.FileLogObserver.timeFormat = ''
+
     def checkDirectory(self, dirpath, description):
         if not os.path.exists(dirpath):
             raise ValueError("%s does not exist: %s" % (description, dirpath,))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070207/80f6a3b4/attachment.html


More information about the calendarserver-changes mailing list