New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #32817 (new defect)

Opened 17 months ago

Last modified 16 months ago

postgresql91-server @9.1.2_0 initialization fails

Reported by: gunnlaugur@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: lion Cc: mww@…, jwa@…, 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

comment:1 Changed 16 months ago by seh@…

  • Cc seh@… added

Cc Me!

comment:2 Changed 16 months 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 16 months ago by gunnlaugur@…

Yep, that worked for me too.

Note: See TracTickets for help on using tickets.