Opened 6 years ago

Last modified 8 months ago

#32817 assigned defect

postgresql91-server @9.1.2_0 initialization fails

Reported by: gthb (Gunnlaugur Thor Briem) Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: lion Cc: seh@…
Port: postgresql91-server

Description

Following install of postgresql91-server, I get these instructions:

To create a database instance, after install do
 sudo mkdir -p /opt/local/var/db/postgresql91/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql91/defaultdb
 sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -D /opt/local/var/db/postgresql91/defaultdb'

The first two lines go OK, but the initdb line fails:

$ sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -D /opt/local/var/db/postgresql91/defaultdb'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
could not identify current directory: Permission denied
could not identify current directory: Permission denied
could not identify current directory: Permission denied
The program "postgres" is needed by initdb but was not found in the
same directory as "initdb".
Check your installation.

The permissions look OK to me:

$ ls -ld /opt/local/var/db/postgresql91/defaultdb
drwxr-xr-x  2 postgres  postgres  68  9 jan 11:51 /opt/local/var/db/postgresql91/defaultdb

$ ls -ld /opt/local/var/db/postgresql91
drwxr-xr-x  3 root  admin  102  9 jan 11:51 /opt/local/var/db/postgresql91

$ ls -ld /opt/local/lib/postgresql91/bin/{initdb,postgres}
-rwxr-xr-x  1 root  admin    71336  9 jan 11:49 /opt/local/lib/postgresql91/bin/initdb
-rwxr-xr-x  1 root  admin  5329336  9 jan 11:49 /opt/local/lib/postgresql91/bin/postgres

$ ls -ld /opt/local/lib/postgresql91/bin
drwxr-xr-x  25 root  admin  850  9 jan 11:49 /opt/local/lib/postgresql91/bin

so I don't know what this is about.

The same happens with postgresql90-server. I have postgresql84-server installed and have been using it without problems for a long time.

I'm on Lion, in case this is specific to that:

$ port platform
Platform: darwin 11 i386

Change History (5)

comment:1 Changed 6 years ago by seh@…

  • Cc seh@… added

Cc Me!

comment:2 follow-up: Changed 6 years ago by seh@…

I see the same problem in conjunction with the pg_ctl program. If I first change directories into the PostgreSQL bin directory and run the same command, it works as expected.

comment:3 Changed 6 years ago by gthb (Gunnlaugur Thor Briem)

Yep, that worked for me too.

comment:4 Changed 10 months ago by mf2k (Frank Schima)

  • Cc mww@… jyrkiwahlstedt removed
  • Owner changed from macports-tickets@… to jyrkiwahlstedt
  • Status changed from new to assigned

comment:5 in reply to: ↑ 2 Changed 8 months ago by paxperscientiam (Chris)

Replying to seh@…:

I see the same problem in conjunction with the pg_ctl program. If I first change directories into the PostgreSQL bin directory and run the same command, it works as expected.

Five years later, this is still the case.

Note: See TracTickets for help on using tickets.