[MacPorts] #58131: postgres-server post-install instructions seem incorrect?

MacPorts noreply at macports.org
Mon Feb 25 08:08:55 UTC 2019

#58131: postgres-server post-install instructions seem incorrect?
 Reporter:  masklinn  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:  postgresql11-server
 After installing the port, a life-saver note is printed providing setup

 notes "\nTo create a database instance, after install do\n\
         sudo mkdir -p ${dbdir}\n\
         sudo chown ${dbuser}:${dbgrp} ${dbdir}\n\
         sudo su ${dbuser} -c \'cd ${dbhome} && ${libdir}/bin/initdb -D
 ${dbdir}\' "

 Unless I'm misreading things or my machine is in a really weird state (as
 these failed) there's an issue with it though: on the last line, it cds to
 `${dbhome}` as `${dbuser}`, but `${dbhome}` *is still owned by root*

 * `${dbdir}` is `${dbhome}/defaultdb`
 * both directories are created as root
 * chown is only applied to `${dbdir}`

 so the postgres user doesn't have access to `${dbhome}` to which it tries
 to cd.

 I don't really know whether the proper fix is to just not cd there at all
 (is it really necessary for initdb?) or to `chown -R ${dbdir}` instead of
 just `${dbhome}`.

 Assuming it's not an error between my keyboard and chair, I think it's a
 long-standing issue too, I remember hitting it on previous versions but
 assuming I'd screwed up somewhere.

Ticket URL: <https://trac.macports.org/ticket/58131>
MacPorts <https://www.macports.org/>
Ports system for macOS

More information about the macports-tickets mailing list