#14083: compatibility improvement for postgresql82-server --------------------------------+------------------------------------------- Reporter: apinstein@mac.com | Owner: macports-tickets@lists.macosforge.org Type: enhancement | Status: new Priority: Normal | Milestone: Port Enhancements Component: ports | Version: 1.6.0 Resolution: | Keywords: --------------------------------+------------------------------------------- Changes (by jmpp@macports.org): * type: defect => enhancement * milestone: => Port Enhancements Old description:
For starting/stopping the server, you should do:
instead of
su postgres -c "${PGCTL} -D ${POSTGRESQL82DATA:=/opt/local/var/db/postgresql82/defaultdb} start -l /opt/local/var/log/postgresql82/postgres.log"
do sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' | ${LOGUTIL} '${PGLOG}' ${ROTATESEC} &"
The latter is the postgresql way now, and doesn't require the "postgres" user to have a login shell, which is more secure.
Also, when creating the "postgresql" user, set the shell to /usr/bin/false.
New description: For starting/stopping the server, you should do: instead of {{{ su postgres -c "${PGCTL} -D ${POSTGRESQL82DATA:=/opt/local/var/db/postgresql82/defaultdb} start -l /opt/local/var/log/postgresql82/postgres.log" }}} do {{{ sudo -u $PGUSER sh -c "${DAEMON} -D '${PGDATA}' | ${LOGUTIL} '${PGLOG}' ${ROTATESEC} &" }}} The latter is the postgresql way now, and doesn't require the "postgres" user to have a login shell, which is more secure. Also, when creating the "postgresql" user, set the shell to `/usr/bin/false`. -- Ticket URL: <http://trac.macosforge.org/projects/macports/ticket/14083#comment:1> MacPorts </projects/macports> Ports system for Mac OS