Recientemente actualicé mi Mac Mini Server a Yosemite y la aplicación Server 4.0. Cuando traté de verificar que Postgres está disponible ejecutando sudo serveradmin fullstatus postgres, aparece el siguiente error:
postgres:error = <62706c69 73743030 d4010203 04050618 19582476 65727369 6f6e5824 6f626a65 63747359 24617263 68697665 72542474 6f701200 0186a0a4 07081112 55246e75 6c6cd409 0a0b0c0d 0e0f1056 4e53436f 64655a4e 53557365 72496e66 6f584e53 446f6d61 696e5624 636c6173 73100180 00800280 035f1014 636f6d2e 6170706c 652e7365 72766572 6d677264 d2131415 165a2463 6c617373 6e616d65 5824636c 61737365 73574e53 4572726f 72a21517 584e534f 626a6563 745f100f 4e534b65 79656441 72636869 766572d1 1a1b5472 6f6f7480 0108111a 232d3237 3c424b52 5d666d6f 7173758c 919ca5ad b0b9cbce d3000000 00000001 01000000 00000000 1c000000 00000000 00000000 00000000 d5>
postgres:errorDescription = "The operation couldn’t be completed. (com.apple.servermgrd error 1.)"
postgres:errorCode = 1
Cuando intenté ejecutar sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.servermgrd.plist, recibí el siguiente error:
/System/Library/LaunchDaemons/com.apple.servermgrd.plist: No existe tal archivo o directorio
Intenté hacer lo mismo en /Library/Preferences/com.apple.servermgrd.plist y obtuve el siguiente error:
/Library/Preferences/com.apple.servermgrd.plist: Invalid or missing service identifier
Supongo que el primer archivo es el que está tratando de acceder y que falta. No estoy seguro de qué eliminó el archivo. ¿Cómo puedo crear este archivo? Tengo sitios web que utilizan el servicio web que están inactivos.
Supongo que si no puedo resolverlo, restauraré la copia de seguridad justo antes de actualizar a Yosemite en mis dos servidores. Oh bien.
"Identificador de servicio no válido o faltante" parece significar que su archivo plist no tiene o tiene una sección mal escrita como
<key>Label</key>
<string>com.foo.bar</string>
Tenga en cuenta que "Etiqueta" debe comenzar con L mayúscula.
A partir de OS X Server versión 4.0, parece que Apple no quiere que usemos el PostgreSQL integrado :
La base de datos de Postgres utilizada por OS X Server solo está diseñada para usarse con los datos de servicio utilizados por el sistema. Evite agregar contenido personalizado a esta base de datos. Si desea ejecutar Postgres en su servidor OS X, debe descargar e instalar su propia instancia.
Pero todavía hay una manera de usarlo. Use los siguientes comandos en la Terminal:
sudo mkdir -p /Library/Server/PostgreSQL/Config
sudo chown -R _postgres:_postgres /Library/Server/PostgreSQL
sudo -u _postgres vim /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist
luego copie, pegue y guarde esto:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ProgramArguments</key>
<array>
<string>-D</string>
<string>/Library/Server/PostgreSQL/Data</string>
<string>-c</string>
<string>listen_addresses=127.0.0.1,::1</string>
<string>-c</string>
<string>log_connections=on</string>
<string>-c</string>
<string>log_directory=/Library/Logs/PostgreSQL</string>
<string>-c</string>
<string>log_filename=PostgreSQL.log</string>
<string>-c</string>
<string>log_line_prefix=%t </string>
<string>-c</string>
<string>log_lock_waits=on</string>
<string>-c</string>
<string>log_statement=ddl</string>
<string>-c</string>
<string>logging_collector=on</string>
<string>-c</string>
<string>unix_socket_directories=/private/var/pgsql_socket</string>
<string>-c</string>
<string>unix_socket_group=_postgres</string>
<string>-c</string>
<string>unix_socket_permissions=0770</string>
</array>
</dict>
</plist>
también editar
sudo vim /System/Library/LaunchDaemons/org.postgresql.postgres.plist
luego copia y pega esto:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.postgresql.postgres</string>
<key>UserName</key>
<string>_postgres</string>
<key>GroupName</key>
<string>_postgres</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Server.app/Contents/ServerRoot/usr/bin/postgres</string>
<string>--apple-configuration</string>
<string>/Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist</string>
</array>
<key>OnDemand</key>
<false/>
<key>StandardErrorPath</key>
<string>/Library/Logs/PostgreSQL/PostgreSQL.log</string>
<key>StandardOutPath</key>
<string>/Library/Logs/PostgreSQL/PostgreSQL.log</string>
</dict>
</plist>
Para instalar hacer
sudo launchctl load -w /System/Library/LaunchDaemons/org.postgresql.postgres.plist
sudo -u _postgres psql postgres
y Postgres le dará la bienvenida con
psql (9.3.5)
Type "help" for help.
postgres=#
En las versiones más recientes de Mac OS X Server (realmente cualquier cosa que se quede sin Server.app), el archivo launchd plist para el demonio backend del servidor vive dentro del mismo paquete Server.app y ya no es administrado directamente por launchctl. Si tiene un archivo en la ruta anterior, quedará de un sistema anterior y ya no funcionará.
Del mismo modo, con el archivo com.apple.servermgrd.plist en las preferencias, no es una lista de tareas de lanzamiento y no se puede cargar con launchctl.
La mayor parte de los archivos de configuración en Server 4.0 y posteriores se encuentran en /Library/Server
klanomath
Pamela Cook - LightBe Corp