configuring and automatically launching postgresql91-server

Puneet Kishor punk.kish at gmail.com
Mon Apr 2 19:47:47 PDT 2012


On Apr 2, 2012, at 9:36 PM, Puneet Kishor wrote:

> I just reinstalled postgresql91-server, and am revisiting a question I asked a few months ago. I am looking for the correct way for configuring and launching postgresql automatically when computer starts.
> 
> Per an email thread from Dec 20, Bradley Giesbrecht advised that I should copy /opt/local/share/postgresql90/postgresql.conf.sample to /opt/local/etc/postgresql.conf and edit it to suit my needs. Well, turns out there is a copy of postgresql.conf under my postgresql data directory as well. I init-ed a db cluster at /Volumes/mydisk/Data/db/postgresql91/defaultdb, and a whole bunch of .conf files are under this defaultdb directory.
> 
> So, which .conf file am I supposed to use? The one under defaultdb is owned by 'postgres' user, so I can't really edit that.
> 
> Additionally, even though I have done `sudo port load postgresql91-server` (as well as `sudo port load apache2`), I get the message that the port file is already loaded, yet the program doesn't really start.
> 
> Suggestions?
> 
> 
Looking at the contents of org.macports.postgresql91-server.plist, I see it calls postgresql91-server.wrapper (in the same directory). That wrapper has the path to the db and logfile hard coded like so

#!/bin/sh
#
# MacPorts generated daemondo support script
#

#
# Init
#
prefix=/opt/local
PGCTL=/opt/local/lib/postgresql91/bin/pg_ctl

#
# Start
#
Start()
{
       su postgres -c "${PGCTL} -D ${POSTGRESQL91DATA:=/opt/local/var/db/postgresql91/defaultdb} start -l /opt/local/var/log/postgresql91/postgres.log


Obviously, this is not what I want. I can easily edit this file, but that is not what I should be doing, right? I shouldn't be tinkering with macports installed bits and bobs, but edit and config only stuff that belongs to me.

Suggestions?


--
Puneet Kishor





More information about the macports-users mailing list