PostgreSQL causing slow shutdowns with OS X Server in Mavericks

Solution 1:

The com.apple.DeviceManagement.postgres line makes me think that this could be related to Profile Manager services. Does it show Profile Manager running in Server.app? If you're not utilizing this service, disabling it may help to stop the shutdown delays.

Alternately, if you need to keep these services running, it may be worth looking at some log files somewhere (/var/log/system.log or /var/log/devicemgr/*?) to see if the profile manager service (or any others) are complaining.

Solution 2:

Any number of services on OS X Server use Postgres. On my server, for example, the Wiki uses it.

While the server is still running try ps ax | grep postgres | less and you will probably see a number of processes, the first ones will almost certainly be some scripts that start Postgres and these should tell you where the logs are located - it will say something like -c log_directory=/Library/Server/Wiki/Logs You might also want to look at /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres which is the Python script that should be used to start Postgres by server services.

This will start you down the road to discovering your problem.