/System/Library/LaunchDaemons/com.apple.servermgrd.plist è mancante - Causare postgres non avviarsi correttamente

4

Recentemente ho aggiornato il mio Mac Mini Server a Yosemite e l'app Server 4.0. Quando ho provato a verificare che Postgres è disponibile eseguendo sudo serveradmin fullstatus postgres, ho il seguente errore:

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

Quando ho tentato di eseguire sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.servermgrd.plist ho ricevuto il seguente errore:

/System/Library/LaunchDaemons/com.apple.servermgrd.plist: nessun file o directory

Ho provato a fare lo stesso in /Library/Preferences/com.apple.servermgrd.plist e ho ottenuto il seguente errore:

/Library/Preferences/com.apple.servermgrd.plist: Invalid or missing service identifier

La mia ipotesi è che il primo file sia quello a cui sta tentando di accedere e che manca. Non sono sicuro di cosa ha cancellato il file. Come posso creare questo file? Ho siti Web che utilizzano il servizio Web non disponibili.

Suppongo che se non riesco a capirlo, ripristinerò il backup subito prima dell'aggiornamento a Yosemite su entrambi i miei server. Oh bene.

    
posta Pamela Cook - LightBe Corp 07.11.2014 - 19:02
fonte

3 risposte

5

"Identificatore di servizio non valido o mancante" sembra significare che il tuo file plist non ha ottenuto o ha scritto male una sezione come

<key>Label</key>
<string>com.foo.bar</string>

Nota "Etichetta" deve iniziare con lettere maiuscole L.

    
risposta data 01.11.2015 - 06:25
fonte
1

A partire da OS X Server versione 4.0 sembra che Apple non voglia che usiamo il PostgreSQL incorporato :

Il database Postgres utilizzato da OS X Server è destinato esclusivamente ai dati di servizio utilizzati dal sistema. Evitare di aggiungere contenuti personalizzati a questo database. Se desideri eseguire Postgres su OS X Server, devi scaricare e installare la tua istanza.

Ma c'è ancora un modo per usarlo. Utilizza i seguenti comandi nel Terminale:

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

quindi copia, incolla e salva questo:

<?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>

Modifica anche

sudo vim /System/Library/LaunchDaemons/org.postgresql.postgres.plist

quindi copia e incolla questo:

<?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>

Per installare fai

sudo launchctl load -w /System/Library/LaunchDaemons/org.postgresql.postgres.plist
sudo -u _postgres psql postgres

e Postgres ti saluteranno con

psql (9.3.5)
Type "help" for help.
postgres=# 
    
risposta data 25.01.2015 - 09:34
fonte
0

Nelle versioni più recenti di Mac OS X Server (in realtà qualcosa che non funziona su Server.app), il file plist di launchd per il daemon backend del server risiede all'interno del bundle Server.app stesso e non è più gestito direttamente da launchctl . Se hai un file nel vecchio percorso, verrà lasciato da un sistema precedente e non funzionerà più.

Allo stesso modo con il file com.apple.servermgrd.plist nelle preferenze, non è un job plist di avvio e non può essere caricato da launchctl.

La maggior parte dei file di configurazione in Server 4.0 e versioni successive sono disponibili in / Library / Server

    
risposta data 13.02.2016 - 10:49
fonte

Leggi altre domande sui tag