postgres launch daemon not working

Scott Frankel frankel at circlesfx.com
Tue Jan 31 17:18:52 PST 2012


Hi Daniel,

It works!  Details follow below.


On Jan 31, 2012, at 1:13 PM, Daniel J. Luke wrote:

> On Jan 31, 2012, at 2:52 PM, Scott Frankel wrote:
>> 	% sudo su postgres -c "/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/postgresql84/defaultdb -l /opt/local/var/postgresql84/defaultdb/data/logfile.txt start"
> 
>> Jan 31 08:29:07 tiento com.apple.SystemStarter[53]: pg_ctl: could not open PID file "/Library/PostgreSQL8/data/postmaster.pid": Permission denied
>> Jan 31 08:29:08 tiento SystemStarter[53]: PostgreSQL database server (90) did not complete successfully
> 
> This looks like you are pointing to a different directory than the one you set up when you installed postgresql84-server (and also a different one than the one you're pointed to when you manually start postgres). 

That's exactly what I was trying to explain in my last email.  I'm doing nothing explicit to point to the /Library/PostgreSQL8/ directory.


>> Looks like pg_ctl is trying to open a postmaster.pid file it doesn't have permissions for.  How can I point launchd invocations of pg_ctl to the correct postgres data dir?  
> 
> If you look at the plist that macports installed, you'll see that it uses a wrapper script to launch the postgres server process. That script will default to using the environment variable $POSTGRESQL84DATA for the data dir (and fall back on the one you show that you're using).
> 
> It's very likely that you have $POSTGRESQL84DATA set, and you don't want it set.

Looks like that env var gets set directly in the wrapper.  Thanks for pointing to the script!  A quick edit of the script's paths and now the server starts on reboot!

Thanks!
Scott


> 
> --
> Daniel J. Luke                                                                   
> +========================================================+                        
> | *---------------- dluke at geeklair.net ----------------* |                          
> | *-------------- http://www.geeklair.net -------------* |                          
> +========================================================+                        
> |   Opinions expressed are mine and do not necessarily   |                          
> |          reflect the opinions of my employer.          |                          
> +========================================================+
> 
> 
> 
> 




More information about the macports-users mailing list