Re: Is it possible to control the location of the lock file when starting postgres?
От | Steve Langlois |
---|---|
Тема | Re: Is it possible to control the location of the lock file when starting postgres? |
Дата | |
Msg-id | CY1PR0701MB1932CD152689FC0324DE11A787080@CY1PR0701MB1932.namprd07.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: Is it possible to control the location of the lock file when starting postgres? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Is it possible to control the location of the lock file
when starting postgres?
Re: Is it possible to control the location of the lock file when starting postgres? |
Список | pgsql-general |
Steve Langlois <steve.langlois@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:
> + /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"?
[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
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.
В списке pgsql-general по дате отправления: