On 07/20/2016 10:44 AM, Steve Langlois wrote:
Steve Langlois <steve.langl...@tavve.com> writes:

I ran
+ /usr/bin/initdb --pgdata=/usr/xxx/databases/pgsql/data --auth=ident
without issue however when I try to start the database it complains about the 
lockfile.
FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": 
Permission denied

I was able to resolve this issue using -k /tmp with postmaster:

postmaster -k "/tmp" -D "/usr/xxx/databases/pgsql/data"

In postgresql.conf I have

listen_addresses = 'localhost'
unix_socket_directories = '/tmp'

However when I try to connect with psql

[13:27:08 slanglois@tron data]$ psql postgres
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"?

The lock file is in /tmp

Tom Lane addressed that in his reply to your post,  here:

https://www.postgresql.org/message-id/16354.1468965669%40sss.pgh.pa.us


[13:28:02 slanglois@tron data]$ ls -al /tmp/.*PGSQL*
srwxrwxrwx 1 slanglois eng  0 Jul 20 13:19 /tmp/.s.PGSQL.5432
-rw------- 1 slanglois eng 59 Jul 20 13:19 /tmp/.s.PGSQL.5432.lock

even though I have the following in pg_hba.conf

local all all trust

I tried to specify the host but it still doesn't connect

[13:32:24 slanglois@tron data]$ psql -h localhost postgres
psql: FATAL:  no pg_hba.conf entry for host "::1", user "slanglois",
database "postgres", SSL off

To get it to connect I have to add the following to pg_hba.conf

host    all             all             ::1/128                 trust

I was going to put this under a new subject but it seems to me like it
is still related to the lock file being expected in /var/run/postgres
when it is trying to connect even though I changed it to /tmp.

Why is the local connection not working without having to add host
::1/128 to the pg_hba.conf file. I thought specifying local all all
trust would allow any local connection.








--
Adrian Klaver
adrian.kla...@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to