Yosemite Server - postgres not running

Upgraded from Mountain Lion Server straight to Yosemite Server and Postgres stopped working.


sudoserveradmin settings list | grep post ---> returns nothing (i.e. not in list)


ps awx | grep postgres ---> returns the following:


=========================================


192 ?? Ss 0:07.33 /usr/bin/python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres -a /Library/Server/ProfileManager/Config/PostgreSQL_config.plist

218 ?? S 0:00.40 /Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real -D /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL -c unix_socket_directories=/Library/Server/ProfileManager/Config/var/PostgreSQL -c logging_collector=on -c log_rotation_size=10MB -c log_connections=on -c log_lock_waits=on -c log_statement=ddl -c log_line_prefix=%t -c listen_addresses= -c log_directory=/Library/Logs/ProfileManager -c log_filename=PostgreSQL-%F.log -c log_min_messages=WARNING -c log_min_error_statement=WARNING -c unix_socket_group=_devicemgr -c unix_socket_permissions=0770 -c max_connections=200

230 ?? Ss 0:00.00 postgres: logger process

233 ?? Ss 0:00.05 postgres: checkpointer process

234 ?? Ss 0:00.23 postgres: writer process

235 ?? Ss 0:00.17 postgres: wal writer process

236 ?? Ss 0:00.64 postgres: autovacuum launcher process

237 ?? Ss 0:00.06 postgres: archiver process

238 ?? Ss 0:01.20 postgres: stats collector process

258 ?? Ss 0:00.24 postgres: wal sender process _devicemgr [local] streaming 0/7011D48

384 ?? Ss 0:00.55 postgres: _devicemgr devicemgr_v2m0 [local] idle

389 ?? Ss 0:00.00 postgres: _devicemgr devicemgr_v2m0 [local] idle

390 ?? Ss 0:00.00 postgres: _devicemgr devicemgr_v2m0 [local] idle

1680 ?? S 0:03.25 /usr/bin/python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directories=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on

1684 ?? S 0:00.21 /Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real -D /Library/Server/Wiki/Database.xpg/Cluster.pg -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directories=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on

1685 ?? Ss 0:00.02 postgres: logger process

1687 ?? Ss 0:00.08 postgres: checkpointer process

1688 ?? Ss 0:00.15 postgres: writer process

1689 ?? Ss 0:00.08 postgres: wal writer process

1690 ?? Ss 0:00.14 postgres: autovacuum launcher process

1691 ?? Ss 0:00.02 postgres: archiver process

1692 ?? Ss 0:00.31 postgres: stats collector process

1697 ?? Ss 0:00.13 postgres: wal sender process _teamsserver [local] streaming 0/A099278

1704 ?? Ss 0:00.01 postgres: collab collab [local] idle

3726 s000 S+ 0:00.00 grep postgres


=========================================


Presumably it is running but not fully


psql ---> returns the following:


psql: could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?


Is it just a case of flicking a switch somewhere or is it broken?

iMac (27-inch Late 2009), OS X Yosemite (10.10)

Posted on Oct 18, 2014 1:40 PM

Reply
1 reply

Dec 23, 2014 12:21 PM in response to samgreyseal

Hi there;


The server is running under user "_devicemgr", and all you have to do is create a symbolic link to

/Library/Server/ProfileManager/Config/var/PostgreSQL in /private/var, as follows:


ln -s /Library/Server/ProfileManager/Config/var/PostgreSQL /private/var/pgsql_socket


Also let others have write/read/exec privileges to the files there:


chmod -R o+wrx /Library/Server/ProfileManager/Config/var/PostgreSQL


Now you can run psql


sudo -u _devicemgr psql -d postgres

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Yosemite Server - postgres not running

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.