[CalendarServer-changes] [14605] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 18 16:24:04 PDT 2015


Revision: 14605
          http://trac.calendarserver.org//changeset/14605
Author:   sagen at apple.com
Date:     2015-03-18 16:24:04 -0700 (Wed, 18 Mar 2015)
Log Message:
-----------
Allow the postgres socket file name to be configurable

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py
    CalendarServer/trunk/conf/caldavd-apple.plist
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/txdav/base/datastore/subpostgres.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2015-03-18 17:23:35 UTC (rev 14604)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2015-03-18 23:24:04 UTC (rev 14605)
@@ -144,6 +144,7 @@
         logFile=config.Postgres.LogFile,
         logDirectory=config.LogRoot if config.Postgres.LogRotation else "",
         socketDir=config.Postgres.SocketDirectory,
+        socketName=config.Postgres.SocketName,
         listenAddresses=config.Postgres.ListenAddresses,
         sharedBuffers=config.Postgres.SharedBuffers,
         maxConnections=config.Postgres.MaxConnections,

Modified: CalendarServer/trunk/conf/caldavd-apple.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd-apple.plist	2015-03-18 17:23:35 UTC (rev 14604)
+++ CalendarServer/trunk/conf/caldavd-apple.plist	2015-03-18 23:24:04 UTC (rev 14605)
@@ -118,6 +118,8 @@
         <string>xpg_ctl.log</string>
         <key>SocketDirectory</key>
         <string>/var/run/caldavd/PostgresSocket</string>
+        <key>SocketName</key>
+        <string>.s.PGSQL.launchd_managed.{}</string>
         <key>LogRotation</key>
         <true/>
     </dict>

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2015-03-18 17:23:35 UTC (rev 14604)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2015-03-18 23:24:04 UTC (rev 14605)
@@ -975,6 +975,7 @@
         "LogFile": "postgres.log",
         "LogRotation": False,
         "SocketDirectory": "",
+        "SocketName": "",
         "ListenAddresses": [],
         "SharedBuffers": 0, # BuffersToConnectionsRatio * MaxConnections
                             # Note: don't set this, it will be computed dynamically

Modified: CalendarServer/trunk/txdav/base/datastore/subpostgres.py
===================================================================
--- CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2015-03-18 17:23:35 UTC (rev 14604)
+++ CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2015-03-18 23:24:04 UTC (rev 14605)
@@ -182,6 +182,7 @@
         logFile="postgres.log",
         logDirectory="",
         socketDir="",
+        socketName="",
         listenAddresses=[], sharedBuffers=30,
         maxConnections=20, options=[],
         testMode=False,
@@ -243,6 +244,7 @@
             digest = md5(dataStoreDirectory.path).hexdigest()
             socketDir = "/tmp/ccs_postgres_" + digest
         self.socketDir = CachingFilePath(socketDir)
+        self.socketName = socketName
 
         if listenAddresses:
             if ":" in listenAddresses[0]:
@@ -356,8 +358,9 @@
 
             if socketFP.isdir():
                 # We have been given the directory, not the actual socket file
+                nameFormat = self.socketName if self.socketName else ".s.PGSQL.{}"
                 socketFP = socketFP.child(
-                    ".s.PGSQL.{}".format(self.port if self.port else 5432)
+                    nameFormat.format(self.port if self.port else 5432)
                 )
 
             if not socketFP.isSocket():
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150318/5951155b/attachment.html>


More information about the calendarserver-changes mailing list