OS X Server.app 4 Completely Breaks PostgreSQL
There a new flavor of brokenness with Server.app 4's PostgreSQL -- it doesn't even exist as a serveradmin service!
Does anyone know how to tell serveradmin to start/stop PostgreSQL?
I've been able to migrate my old data and get a running PostgreSQL server with these commands:
su -
mv /Library/Server/PostgreSQL/Data /Library/Server/PostgreSQL/DataOld
rm -fr /Library/Server/PostgreSQL/Data
mkdir -p /Library/Server/PostgreSQL/Data
chown -R _postgres:_postgres /Library/Server/PostgreSQL/Data
chmod 700 /Library/Server/PostgreSQL/Data
sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Library/Server/PostgreSQL/Data -E utf8 --lc-ctype=C
# assume migration put old pg data in /Library/Server/PostgreSQL/Data-9.2
sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_upgrade -b /Applications/Server.app/Contents/ServerRoot/usr/libexec/postgresql9.2 -B /Applications/Server.app/Contents/ServerRoot/usr/bin -d /Library/Server/PostgreSQL/Data-9.2 -D /Library/Server/PostgreSQL/Data
# Server.app 4 doesn't include the postgres launch plist!
# assume your previous <= Mavericks backup is in /Volumes/Backup
cp /Volumes/Backup/Applications/Server.app/Contents/ServerRoot/System/Library/Laun chDaemons/org.postgresql.postgres.plist /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/
launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/org.p ostgresql.postgres.plist
lsof -i ':5432'
nmap -p 5432 localhost
See here and here for background on how to fix postgres in Server.app 3.1.2.
Now the problem is that postgres launches don't persist over reboots, and that serveradmin doesn't control postgres. The commands
sudo serveradmin start postgres
sudo serveradmin start expialidocious
both return the same error because neither are serveradmin-managed services.
How does one get serveradmin start postgres to work?
Mac mini, OS X Mavericks (10.9), Server, 16 GB, EyeTV+Turbo.264 HD