So I checked Snow Leopard's launchctl, which was responsible for starting processes at startup.
sudo launchctl list |grep post
549 1 com.edb.launchd.postgresql-9.0
Not good. The second number tells me that postmaster has exited with a value of 1. Which most Unix users will know is an exit with error.
So OS X is launching the postmaster, but postmaster keeps exiting with an error. So what's the error? I'll try to launch postmaster in the exact same way that OS X is trying to launch, but I'll do it on the command line, so I can see the error myself.
First, I got to find the command that Launchctl uses. I thus open "/Library/LaunchDaemons/com.edb.launchd.postgresql-9.0.plist":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.edb.launchd.postgresql-9.0</string>
<key>ProgramArguments</key>
<array>
<string>/Library/PostgresPlus/9.0SS/bin/postmaster</string>
<string>-D/Library/PostgresPlus/9.0SS/data</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>postgres</string>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
</dict>
</plist>
This tells me the command to run is "sudo /Library/PostgresPlus/9.0SS/bin/postmaster -D/Library/PostgresPlus/9.0SS/data". So I run that:
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.
Ok. Can't execute that command as root. I know that PostgreSQL server is started under the user "postgres". So I try that:
sudo -u postgres /Library/PostgresPlus/9.0SS/bin/postmaster -D/Library/PostgresPlus/9.0SS/data
GMT FATAL: lock file "postmaster.pid" already exists
GMT HINT: Is another postmaster (PID 62) running in data directory "/Library/PostgresPlus/9.0SS/data"?
Ahhhh… Apparently another process has opened the pid lock file. Next step is to kill that offending process and try again. I can do it on the command line, but where possible, I try to do it using OS X's GUI :) Steve wants it done his way… So I open Activity Monitor, find PID = 62, and "Quit Process".
Everything is now fixed.
No comments:
Post a Comment