Fixing Server PostgreSQL Services
A few weeks ago, my hard drive died on me. I hadn't backed up in a while, so I used DataRescue to recover most of my drive (and replaced anything it marked as corrupt) followed by a clean install and migration from the recovered data. However, I don't think it did a great job with permissions. I think I've fixed most of it, but I'm having some issues with Server. In the logs, I see the following message constantly:
Aug 8 01:20:28 shakespeare com.apple.launchd[1] (com.apple.postgres[491]): Exited with code: 2
Aug 8 01:20:28 shakespeare com.apple.launchd[1] (com.apple.postgres): Throttling respawn: Will start in 10 seconds
In Server, it can't load the settings for several services (wiki, profile manager, mail) and gives me the following message:
An error occurred on the server while reading settings.
The error occurred while reading settings for the Mail service.
At the same time, in the console I see:
Aug 8 22:27:51 shakespeare.local collabd[18403]: [CSConnectionPool:152 8481000 +0ms] Could not open a connection to Postgres. Please make sure it is running and has the correct access.
I've also seen other postgre related log messages:
Aug 7 23:51:28 shakespeare.local sudo[1248]: root : user NOT in sudoers ; TTY=unknown ; PWD=/ ; USER=_postgres ; COMMAND=/Applications/Server.app/Contents/ServerRoot/usr/bin/initdb --encoding UTF8 -D /Library/Server/PostgreSQL For Server Services/Data
Aug 7 23:51:43 shakespeare.local serveradmin[1918]: servermgr_postgres_server: waiting for postgres to respond
From all of this, I sermize that it's a permissions issue related to the user _postgres. Does anyone know how to fix this? Which file's permissions should I look at?
MacBook Pro (13-inch Mid 2009), OS X Mountain Lion (10.8.4)