[SAC] PostgreSQL on TracSVN machine over max connections

The PostgreSQL server on TracSVN VM reports having reached
max connections (200, per current configuration).

It's been logging this for days, after just one day from start:

  2018-05-22 09:06:03 GMT FATAL: the database system is starting up
  [...]
  2018-05-22 09:06:03 GMT LOG: database system is ready to accept connections
  [...]
  2018-06-26 08:22:01 GMT FATAL: sorry, too many clients already

Logs do not contain any information about clients.
According to netstat there are only 2 TCP connections (which I think
we should forbid, unless there's a reason not to) so I guess all
others are done via unix sockets.

This is PostgreSQL-10 running, dunno since when.
Can anyone join #osgeo-sac to help with fixing the issue ?
For now I'll restart it

--strk;

On Tue, Jun 26, 2018 at 10:30:09AM +0200, Sandro Santilli wrote:

According to netstat there are only 2 TCP connections (which I think
we should forbid, unless there's a reason not to) so I guess all
others are done via unix sockets.

I found that at least one of the 2 TCP connections was coming
from Gitea, which is now fixed to use unix socket:
https://git.osgeo.org/gitea/sac/gitea-config/commit/a5db6075
(you need authorization to see)

All the other connections were from Trac,
for which I filed a ticket about:
https://trac.osgeo.org/osgeo/ticket/2176

During the audit I found we're also using a very unsecure
configuration of PostgreSQL which should be fixed ASAP.

Martin, is your contract still ongoing ? Can you look at it ?
Fixing Trac access would be the first step:
https://trac.osgeo.org/osgeo/ticket/2175

--strk;