pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
3+ messages / 3 participants
[nested] [flat]

* BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
@ 2016-04-14 03:58 porjo38@yahoo.com.au
  2016-04-14 11:13 ` Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container Devrim Gündüz <devrim@gunduz.org>
  0 siblings, 1 reply; 3+ messages in thread

From: porjo38@yahoo.com.au @ 2016-04-14 03:58 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14083
Logged by:          Ian
Email address:      porjo38@yahoo.com.au
PostgreSQL version: 9.5.2
Operating system:   Centos7
Description:        

# /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

If I comment out the lines from 'postgresql95-setup' that call 'systemctl',
initdb executes succesfully.

I'm using RPM packages from http://yum.postgresql.org/:

# rpm -qa | grep postgres
postgresql95-libs-9.5.2-1PGDG.rhel7.x86_64
postgresql95-9.5.2-1PGDG.rhel7.x86_64
postgresql95-server-9.5.2-1PGDG.rhel7.x86_64




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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
  2016-04-14 03:58 BUG #14083: 'postgresql95-setup initdb' breaks inside docker container porjo38@yahoo.com.au
@ 2016-04-14 11:13 ` Devrim Gündüz <devrim@gunduz.org>
  2016-04-14 22:49   ` Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container IanB <porjo38@yahoo.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: Devrim Gündüz @ 2016-04-14 11:13 UTC (permalink / raw)
  To: porjo38@yahoo.com.au; pgsql-bugs


Hi,

On Thu, 2016-04-14 at 03:58 +0000, porjo38@yahoo.com.au wrote:
> Description:        
> 
> # /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.

Regards,
-- 
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container
  2016-04-14 03:58 BUG #14083: 'postgresql95-setup initdb' breaks inside docker container porjo38@yahoo.com.au
  2016-04-14 11:13 ` Re: BUG #14083: 'postgresql95-setup initdb' breaks inside docker container Devrim Gündüz <devrim@gunduz.org>
@ 2016-04-14 22:49   ` IanB <porjo38@yahoo.com.au>
  0 siblings, 0 replies; 3+ messages in thread

From: IanB @ 2016-04-14 22:49 UTC (permalink / raw)
  To: 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!?



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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-04-14 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 03:58 BUG #14083: 'postgresql95-setup initdb' breaks inside docker container porjo38@yahoo.com.au
2016-04-14 11:13 ` Devrim Gündüz <devrim@gunduz.org>
2016-04-14 22:49   ` IanB <porjo38@yahoo.com.au>

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