[CalendarServer-changes] [11561] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 25 16:03:22 PDT 2013


Revision: 11561
          http://trac.calendarserver.org//changeset/11561
Author:   sagen at apple.com
Date:     2013-07-25 16:03:22 -0700 (Thu, 25 Jul 2013)
Log Message:
-----------
Always go through xpg_ctl.  Also, tell launchd not to kill the other processes in our group (especially xpostgres) 1: because we already manage spawned processes ourself, and 2: xpostgres may need to survive because others may be using postgres and xpostgres is in charge or the refcounting.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/launchd/calendarserver.plist
    CalendarServer/trunk/txdav/base/datastore/subpostgres.py

Modified: CalendarServer/trunk/contrib/launchd/calendarserver.plist
===================================================================
--- CalendarServer/trunk/contrib/launchd/calendarserver.plist	2013-07-25 22:34:22 UTC (rev 11560)
+++ CalendarServer/trunk/contrib/launchd/calendarserver.plist	2013-07-25 23:03:22 UTC (rev 11561)
@@ -38,6 +38,9 @@
 
   <key>InitGroups</key>
   <true/>
+  
+  <key>AbandonProcessGroup</key>
+  <true/>
 
   <key>KeepAlive</key>
   <true/>

Modified: CalendarServer/trunk/txdav/base/datastore/subpostgres.py
===================================================================
--- CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2013-07-25 22:34:22 UTC (rev 11560)
+++ CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2013-07-25 23:03:22 UTC (rev 11561)
@@ -402,22 +402,6 @@
             createDatabaseCursor.execute("commit")
             return createDatabaseConn, createDatabaseCursor
 
-        # TODO: always go through pg_ctl start
-        try:
-            createDatabaseConn, createDatabaseCursor = createConnection()
-        except pgdb.DatabaseError:
-            # We could not connect the database, so attempt to start it
-            pass
-        except Exception, e:
-            # Some other unexpected error is preventing us from connecting
-            # to the database
-            log.warn("Failed to connect to Postgres: {e}", e=e)
-        else:
-            # Database is running, so just use our connection
-            self.ready(createDatabaseConn, createDatabaseCursor)
-            self.deactivateDelayedShutdown()
-            return
-
         monitor = _PostgresMonitor(self)
         pgCtl = self.pgCtl()
         # check consistency of initdb and postgres?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130725/df28f6b0/attachment-0001.html>


More information about the calendarserver-changes mailing list