Opened 8 years ago

Closed 3 years ago

#39341 closed enhancement (fixed)

postgresql93-server @9.3beta1: more robust initdb invocation

Reported by: gthb (Gunnlaugur Thor Briem) Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: postgresql93-server

Description

The current invocation of initdb suggested in post-install output:

    sudo su postgres -c '/opt/local/lib/postgresql93/bin/initdb -D /opt/local/var/db/postgresql93/defaultdb'

fails with somewhat confusing error messages if the user is in a directory not accessible to the postgres user — and that's typically the case.

The attached patch changes this to a sudo -i -u postgres invocation, which doesn't care which directory you run it from. That ought to cut down on people stumbling on the initdb step as in #32817.

Attachments (1)

Portfile-postgresql93-server.diff (518 bytes) - added by gthb (Gunnlaugur Thor Briem) 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by gthb (Gunnlaugur Thor Briem)

comment:1 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: mww@… added
Owner: changed from macports-tickets@… to jwa@…
Summary: postgresql93-server @9.3beta1 more robust initdb invocationpostgresql93-server @9.3beta1: more robust initdb invocation
Version: 2.1.3

Thanks. In the future, please Cc relevant port maintainers.

comment:2 Changed 4 years ago by mf2k (Frank Schima)

Cc: mww@… removed
Status: newassigned

comment:3 Changed 3 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

In a2ce1b3d3f2dbd9b776c7c72fd8c14c709252c77/macports-ports (master):

postgresql9{1,2,3,4}-server: fix db creation notes

Running the previously suggested command from a directory not readable
by the postgres user would fail.

Maintainer timeout.
Fixes: #32817
Fixes: #39341
Fixes: #49095

Note: See TracTickets for help on using tickets.