From: IanB <porjo38@yahoo.com.au>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
Date: Fri, 15 Apr 2016 08:49:53 +1000
Message-ID: <57101E91.50706@yahoo.com.au> (raw)
In-Reply-To: <1460632399.897.7.camel@gunduz.org>
References: <20160414035835.22934.58240@wrigleys.postgresql.org>
<1460632399.897.7.camel@gunduz.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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!?
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: porjo38@yahoo.com.au
Subject: Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
In-Reply-To: <57101E91.50706@yahoo.com.au>
References: <20160414035835.22934.58240@wrigleys.postgresql.org> <1460632399.897.7.camel@gunduz.org> <57101E91.50706@yahoo.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox