Обсуждение: pg_createcluster not obeying default for socket directory

Поиск
Список
Период
Сортировка

pg_createcluster not obeying default for socket directory

От
"Colin 't Hart"
Дата:
Hi,

Just installed 9.3b2 from the PG group's APT repository. Because I'm
upgrading from 9.3b1 I need to recreate my cluster.

I get this warning when creating the cluster:

colin@corundum:~$ sudo pg_createcluster 9.3 main --start
Creating new cluster 9.3/main ...
  config /etc/postgresql/9.3/main
  data   /var/lib/postgresql/9.3/main
  locale en_US.UTF-8
Warning: The socket directory for owners other than 'postgres'
defaults to /tmp. You might want to change the unix_socket_directories parameter
in postgresql.conf to a more secure directory.
  port   5432
colin@corundum:~$

Yet, acccording to pg_createcluster when run with no arguments,

colin@corundum:~$ pg_createcluster
Usage: /usr/bin/pg_createcluster [options] <version> <cluster name>
[-- <initdb options>]

Options:
  -s <dir>      socket directory (default: /var/run/postgresql for clusters
                owned by 'postgres', /tmp for other clusters)

[other options snipped]


This seems like a bug to me. I checked -- my cluster is owned by
'postgres' as is the default.

Cheers,

Colin


Re: pg_createcluster not obeying default for socket directory

От
"Colin 't Hart"
Дата:
PS

For completeness:

colin@corundum:~$ grep unix_socket_dir /etc/postgresql/9.3/main/postgresql.conf
unix_socket_directories = '/tmp'    # comma-separated list of directories
colin@corundum:~$


So despite pg_createcluster claiming that the default socket directory
for clusters owned by 'postgres' is /var/run/postgresql, it has indeed
used /tmp and as a result displays a warning.

Cheers,

Colin


Re: pg_createcluster not obeying default for socket directory

От
Christoph Berg
Дата:
Re: Colin 't Hart 2013-08-01 <CAMon-aRowt7ECfd1skCHL-NqRUZ50fE_FosO=-v3WecDeF3EGw@mail.gmail.com>
> Hi,
>
> Just installed 9.3b2 from the PG group's APT repository. Because I'm
> upgrading from 9.3b1 I need to recreate my cluster.
>
> I get this warning when creating the cluster:
>
> colin@corundum:~$ sudo pg_createcluster 9.3 main --start
> Creating new cluster 9.3/main ...
>   config /etc/postgresql/9.3/main
>   data   /var/lib/postgresql/9.3/main
>   locale en_US.UTF-8
> Warning: The socket directory for owners other than 'postgres'
> defaults to /tmp. You might want to change the unix_socket_directories parameter
> in postgresql.conf to a more secure directory.

Hi Colin,

can you run a few commands so we have more details about your system?

getent passwd postgres
ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
dpkg -l 'postgresql-*common'

Christoph
--
cb@df7cb.de | http://www.df7cb.de/


Re: pg_createcluster not obeying default for socket directory

От
"Colin 't Hart"
Дата:
A new week, back at work:

colin@corundum:~$ getent passwd postgres
postgres:x:104:113:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash

colin@corundum:~$ ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
ls: cannot access /var/run/postgresql: No such file or directory
drwx------ 15 postgres postgres 4096 2013-08-01 10:39
/var/lib/postgresql/9.3/main

colin@corundum:~$ sudo ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
[sudo] password for colin:
ls: cannot access /var/run/postgresql: No such file or directory
drwx------ 15 postgres postgres 4096 2013-08-01 10:39
/var/lib/postgresql/9.3/main

colin@corundum:~$ dpkg -l 'postgresql-*common'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version                 Description
+++-=======================-=======================-==============================================================
ii  postgresql-client-commo 147.pgdg10.4+1          manager for
multiple PostgreSQL client versions
ii  postgresql-common       147.pgdg10.4+1          PostgreSQL
database-cluster manager



Cheers,

Colin


On 2 August 2013 10:43, Christoph Berg <cb@df7cb.de> wrote:
> Re: Colin 't Hart 2013-08-01 <CAMon-aRowt7ECfd1skCHL-NqRUZ50fE_FosO=-v3WecDeF3EGw@mail.gmail.com>
>> Hi,
>>
>> Just installed 9.3b2 from the PG group's APT repository. Because I'm
>> upgrading from 9.3b1 I need to recreate my cluster.
>>
>> I get this warning when creating the cluster:
>>
>> colin@corundum:~$ sudo pg_createcluster 9.3 main --start
>> Creating new cluster 9.3/main ...
>>   config /etc/postgresql/9.3/main
>>   data   /var/lib/postgresql/9.3/main
>>   locale en_US.UTF-8
>> Warning: The socket directory for owners other than 'postgres'
>> defaults to /tmp. You might want to change the unix_socket_directories parameter
>> in postgresql.conf to a more secure directory.
>
> Hi Colin,
>
> can you run a few commands so we have more details about your system?
>
> getent passwd postgres
> ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
> dpkg -l 'postgresql-*common'
>
> Christoph
> --
> cb@df7cb.de | http://www.df7cb.de/


Re: pg_createcluster not obeying default for socket directory

От
"Colin 't Hart"
Дата:
OK, so for some weird reason /var/run/postgresql doesn't exist. I've
not created it or deleted it manually, all packages have been
installed via APT.

On 5 August 2013 10:09, Colin 't Hart <colinthart@gmail.com> wrote:
> A new week, back at work:
>
> colin@corundum:~$ getent passwd postgres
> postgres:x:104:113:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
>
> colin@corundum:~$ ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
> ls: cannot access /var/run/postgresql: No such file or directory
> drwx------ 15 postgres postgres 4096 2013-08-01 10:39
> /var/lib/postgresql/9.3/main
>
> colin@corundum:~$ sudo ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
> [sudo] password for colin:
> ls: cannot access /var/run/postgresql: No such file or directory
> drwx------ 15 postgres postgres 4096 2013-08-01 10:39
> /var/lib/postgresql/9.3/main
>
> colin@corundum:~$ dpkg -l 'postgresql-*common'
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name                    Version                 Description
> +++-=======================-=======================-==============================================================
> ii  postgresql-client-commo 147.pgdg10.4+1          manager for
> multiple PostgreSQL client versions
> ii  postgresql-common       147.pgdg10.4+1          PostgreSQL
> database-cluster manager
>
>
>
> Cheers,
>
> Colin
>
>
> On 2 August 2013 10:43, Christoph Berg <cb@df7cb.de> wrote:
>> Re: Colin 't Hart 2013-08-01 <CAMon-aRowt7ECfd1skCHL-NqRUZ50fE_FosO=-v3WecDeF3EGw@mail.gmail.com>
>>> Hi,
>>>
>>> Just installed 9.3b2 from the PG group's APT repository. Because I'm
>>> upgrading from 9.3b1 I need to recreate my cluster.
>>>
>>> I get this warning when creating the cluster:
>>>
>>> colin@corundum:~$ sudo pg_createcluster 9.3 main --start
>>> Creating new cluster 9.3/main ...
>>>   config /etc/postgresql/9.3/main
>>>   data   /var/lib/postgresql/9.3/main
>>>   locale en_US.UTF-8
>>> Warning: The socket directory for owners other than 'postgres'
>>> defaults to /tmp. You might want to change the unix_socket_directories parameter
>>> in postgresql.conf to a more secure directory.
>>
>> Hi Colin,
>>
>> can you run a few commands so we have more details about your system?
>>
>> getent passwd postgres
>> ls -ld /var/lib/postgresql/9.3/main /var/run/postgresql
>> dpkg -l 'postgresql-*common'
>>
>> Christoph
>> --
>> cb@df7cb.de | http://www.df7cb.de/