Re: [GENERAL] Unable to connect to Postgresql - Mailing list pgsql-general

From John Iliffe
Subject Re: [GENERAL] Unable to connect to Postgresql
Date
Msg-id 201704101623.48146.john.iliffe@iliffe.ca
Whole thread Raw
In response to Re: [GENERAL] Unable to connect to Postgresql  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: [GENERAL] Unable to connect to Postgresql  (Rick Widmer <pgsql@rickwidmer.com>)
Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [GENERAL] Unable to connect to Postgresql  ("Daniel Verite" <daniel@manitou-mail.org>)
Re: [GENERAL] Unable to connect to Postgresql  (rob stone <floriparob@gmail.com>)
Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Monday 10 April 2017 11:53:35 Daniel Verite wrote:
>     John Iliffe wrote:
> > So, the problem is resolved, although I have no idea why it was
> > necessary.
>
> The key seems to be the PrivateTmp=true in the systemd service.
> Apache is not chrooted as demonstrated upthread, but that
> setting alone makes the normal, system-wide /tmp inaccessible
> to its processes, including the postgres Unix domain socket opened
> there.
>
> I suspect that your attempt to set PrivateTmp=false as a test was
> missed by systemd  for some reason. You could probably insist
> in that direction and eventually make it work, but I don't see
> how it's better than the alternative /var/pgsql or localhost through
> TCP.
>
> > Also, I now have several hundred programmes to update to add the host
> > path and none of them will now be portable.
>
> Given that you set two directories: /tmp and /var/pgsql,
> I would think you can let the other apps use /tmp as before
> and have only Apache use /var/pgsql ?

Yes, I will do that, but there are several hundred PHP web page scripts to
be updated.  Presumably if one script opens two different databases then
both of the pg_connect() instances will need to be updated.

>
>
> Best regards,


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Are multiple array_aggs going to be in the same order?
Next
From: Rick Widmer
Date:
Subject: Re: [GENERAL] Unable to connect to Postgresql