Re: Is it possible to control the location of the lock file when starting postgres?

From: Steve Langlois <steve(dot)langlois(at)tavve(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is it possible to control the location of the lock file when starting postgres?
Date: 2016-07-21 00:12:06
Message-ID: F3B1BA29-032B-491F-AB24-08BC0B052D72@tavve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jul 20, 2016, at 7:48 PM, Steve Langlois <steve(dot)langlois(at)tavve(dot)com<mailto:steve(dot)langlois(at)tavve(dot)com>> wrote:

you never did answer my previous question, why are you messing about with manually starting postgres from the wrong user account, when it should be run as a system service with systemctl ?

I am upgrading an existing system running CentOS 5.6 with Postgres 8.2.5 to CentOS 7 with 9.2.15. The original system modified the postgresql script to manually running postmaster to start the database under the current user control. So it is really for compatibility with the rest of the code.

If local is used for unix domain socket connections do I change --auth to --auth-local=ident for initdb?

I tried the following:

/usr/bin/initdb --pgdata=/usr/test/databases/pgsql1/data --auth-local=trust

changed unix_socket_directories = '/tmp’ in postgresql.conf.

Then ran:

/usr/bin/postgres -k /tmp -D /usr/tavve/databases/pgsql1/data &

Contents of pg_hba.conf is

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32<http://127.0.0.1/32> trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication slanglois trust
#host replication slanglois 127.0.0.1/32<http://127.0.0.1/32> trust
#host replication slanglois ::1/128 trust

Then I try to run psql and

[20:01:11 slanglois(at)tron bin]$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432”?

I would expect local all all trust to allow me to connect.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Langlois 2016-07-21 00:14:48 Re: Is it possible to control the location of the lock file when starting postgres?
Previous Message John R Pierce 2016-07-21 00:03:38 Re: Is it possible to control the location of the lock file when starting postgres?