[CalendarServer-changes] [14501] CalendarServer/trunk/txdav/base/datastore/subpostgres.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 4 12:00:15 PST 2015
Revision: 14501
http://trac.calendarserver.org//changeset/14501
Author: wsanchez at apple.com
Date: 2015-03-04 12:00:15 -0800 (Wed, 04 Mar 2015)
Log Message:
-----------
Use long options
Modified Paths:
--------------
CalendarServer/trunk/txdav/base/datastore/subpostgres.py
Modified: CalendarServer/trunk/txdav/base/datastore/subpostgres.py
===================================================================
--- CalendarServer/trunk/txdav/base/datastore/subpostgres.py 2015-03-04 00:46:44 UTC (rev 14500)
+++ CalendarServer/trunk/txdav/base/datastore/subpostgres.py 2015-03-04 20:00:15 UTC (rev 14501)
@@ -324,7 +324,9 @@
m = getattr(self, "_connectorFor_{}".format(postgres.__name__), None)
if m is None:
- raise InternalDataStoreError("Unknown Postgres DBM module: {}".format(postgres))
+ raise InternalDataStoreError(
+ "Unknown Postgres DBM module: {}".format(postgres)
+ )
return m(databaseName)
@@ -481,7 +483,7 @@
)
if self.socketDir:
options.append(
- "-k {}"
+ "-c unix_socket_directories={}"
.format(shell_quote(self.socketDir.path))
)
if self.port:
@@ -512,23 +514,17 @@
if self.testMode:
options.append("-c log_statement=all")
- log.info(
- "Requesting postgres start via {cmd} {opts}",
- cmd=self._pgCtl, opts=options
- )
+ args = [
+ self._pgCtl, "start",
+ "--log={}".format(self.logFile),
+ "--timeout=86400", # Plenty of time for a long cluster upgrade
+ "-w", # Wait for startup to complete
+ "-o", " ".join(options), # Options passed to postgres
+ ]
+
+ log.info("Requesting postgres start via: {args}", args=args)
self.reactor.spawnProcess(
- monitor, self._pgCtl,
- [
- self._pgCtl,
- "start",
- "-l", self.logFile,
- "-t 86400", # Give plenty of time for a long cluster upgrade
- "-w",
- # XXX what are the quoting rules for '-o'? do I need to repr()
- # the path here?
- "-o",
- " ".join(options),
- ],
+ monitor, self._pgCtl, args,
env=self.env, path=self.workingDir.path,
uid=self.uid, gid=self.gid,
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150304/65023077/attachment-0001.html>
More information about the calendarserver-changes
mailing list