# HG changeset patch # User Julien Cristau # Date 1397130871 -7200 # Node ID a3a516cf8624c5834065304c5ba85cf5d53fa71f # Parent f0130c270793e14b7822e532a486a82ca0e7d3ec [devtools] set PGPORT/PGHOST when calling pg_ctl start Helps pg_ctl find the socket on squeeze, otherwise it looks in /var/run/postgresql. diff -r f0130c270793 -r a3a516cf8624 devtools/__init__.py --- a/devtools/__init__.py Thu Apr 10 10:59:08 2014 +0200 +++ b/devtools/__init__.py Thu Apr 10 13:54:31 2014 +0200 @@ -548,7 +548,12 @@ if not exists(datadir): subprocess.check_call(['initdb', '-D', datadir, '-E', 'utf-8', '--locale=C']) port = self.system_source['db-port'] - subprocess.check_call(['pg_ctl', 'start', '-w', '-D', datadir, '-o', '-h "" -k /tmp -p %s' % port]) + directory = self.system_source['db-host'] + env = os.environ.copy() + env['PGPORT'] = str(port) + env['PGHOST'] = str(directory) + subprocess.check_call(['pg_ctl', 'start', '-w', '-D', datadir, '-o', '-h "" -k %s -p %s' % (directory, port)], + env=env) self.__CTL.add(datadir) @property