Issue with LaunchDaemon After Upgrade to 10.7.2
I've installed PostgreSQL from source, which has been working great ever since Leopard. I've just now run into an issue after the 10.7.2 upgrade where the LaunchDaemon fails to start PostgreSQL.
Here's the contents of the LaunchDaemon: https://gist.github.com/041fb2b620677370354d
The errors I've been seeing in the Console look like this:
10/12/11 9:00:00.354 PM com.apple.launchd: (org.postgresql.postmaster[100]) open("/usr/local/pgsql/logfile", ...): Permission denied
10/12/11 9:00:00.355 PM com.apple.launchd: (org.postgresql.postmaster[100]) open("/usr/local/pgsql/logfile", ...): Permission denied
10/12/11 9:00:01.328 PM org.postgresql.postmaster: postmaster cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": Permission denied
10/12/11 9:00:01.539 PM com.apple.launchd: (org.postgresql.postmaster[100]) Exited with code: 2
After some poking around, I've come to the conclusion that launchd is no longer switching to the proper user (_postgres) when trying to start the daemon.
Upon further experimentation, I found that by changing the UserName value from _postgres to postgres, the service starts up properly, albeit with the following warning in the Console:
10/13/11 12:10:24.093 PM com.apple.launchd: (org.postgresql.postmaster[4296]) Suspicious setup: User "postgres" maps to user: _postgres
I'm willing to live with this for now, but I'd love to know why this has stopped working, and if anyone else has run into this.
N.B. I followed the instructions here when creating the _postgres user and group.
MacBook Pro, Mac OS X (10.7.1)