Blob Blame History Raw
From 583ec681003395d5f3c3443c7ec82404b187afb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <dvratil@redhat.com>
Date: Wed, 7 May 2014 14:22:13 +0200
Subject: [PATCH 7/7] PostgreSQL: Don't listen for TCP/IP connections

Fixes Akonadi with internal PostgreSQL not starting when system-wide PostgreSQL
server is already running. We don't need TCP/IP anyway, because we talk to our
PostgreSQL via a Unix-socket.
---
 server/src/storage/dbconfigpostgresql.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/src/storage/dbconfigpostgresql.cpp b/server/src/storage/dbconfigpostgresql.cpp
index ce8067b..83a5f91 100644
--- a/server/src/storage/dbconfigpostgresql.cpp
+++ b/server/src/storage/dbconfigpostgresql.cpp
@@ -221,9 +221,10 @@ void DbConfigPostgresql::startInternalServer()
             << QString::fromLatin1( "-w" )
             << QString::fromLatin1( "--timeout=10" ) // default is 60 seconds.
             << QString::fromLatin1( "--pgdata=%1" ).arg( mPgData )
-            // set the directory for unix domain socket communication
-            // -o will pass the switch to postgres
-            << QString::fromLatin1( "-o \"-k%1\"" ).arg( socketDir );
+            // These options are passed to postgres
+            //  -k - directory for unix domain socket communication
+            //  -h - disable listening for TCP/IP
+            << QString::fromLatin1( "-o \"-k%1\" -h ''" ).arg( socketDir );
 
   QProcess pgCtl;
   pgCtl.start( mServerPath, arguments );
-- 
1.9.3