Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container

Поиск
Список
Период
Сортировка
От IanB
Тема Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
Дата
Msg-id 57101E91.50706@yahoo.com.au
обсуждение исходный текст
Ответ на Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container  (Devrim Gündüz <devrim@gunduz.org>)
Список pgsql-bugs
On 14/04/16 21:13, Devrim Gündüz wrote:
 >>
 >> # /usr/pgsql-9.5/bin/postgresql95-setup initdb
 >> Failed to get D-Bus connection: Operation not permitted
 >> failed to find PGDATA setting in postgresql-9.5.service
 >
 > Are you running these as root or postgres user?
 >
 > I think they need to be run with root.

Yes, it is running as postgres user. Looking at postgresql95-setup I can
see that the only reason it is running 'systemctl' is to determine the
PGDATA path, as follows:

PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |
                   sed 's/^Environment=//' | tr ' ' '\n' |
                   sed -n 's/^PGDATA=//p' | tail -n 1`
if [ x"$PGDATA" = x ]; then
       echo "failed to find PGDATA setting in ${SERVICE_NAME}.service"
       exit 1
fi


Further down it gets PGDATA again as follows:

# Get data directory from the service file
PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"`


When I comment out the first method, PGDATA is set from second method
and the script runs successfully *without* needing root privileges. Is
the first method even necessary!?

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bus error in pg_logical_slot_get_changes (9.4.7, sparc)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14033: cross-compilation to ARM fails