Domanda:
Ho ricevuto un errore "Impossibile avviare il server di database PostgreSQL – Agente di autenticazione non registrato per processo unix ' durante l'avvio del server PostgreSQL su una macchina CentOS. L'errore indica che il servizio non è riuscito a causa di un agente di autenticazione non registrato per il processo unix ed è segnalato da polkitd servizio. Comprendo che il polkitd è un demone di sistema e il suo agente di autenticazione verifica l'identità dell'utente prima di eseguire un'azione. Il comando ' journalctl -xe' e /var/log/secure rivela lo stesso.
Ecco il messaggio di errore completo:
# service postgresql start ::::::::::::::::::::::::::::::::::::: test.in systemd[1]: Unit postgresql.service entered failed state. test.in systemd[1]: postgresql.service failed. test.in polkitd[18278]: Unregistered Authentication Agent for unix-process:22928:182581476 (system bus name :1.1038, object path test.in chronyd[513]: Source 45.125.255.54 replaced with 123.108.200.124 test.in polkitd[18278]: Registered Authentication Agent for unix-process:22988:182656818 (system bus name :1.1039 [/usr/bin/pktty test.in systemd[1]: Starting PostgreSQL database server...
Come risolvere il problema?
Soluzione:
Ho riscontrato un errore simile e i passaggi seguenti lo hanno risolto per me.
Passaggio 1 :passa a postgres utente
# su - postgres
Passaggio 2: Inizializza il server del database
$ initdb The files belonging to this database system will be owned by user "postgres". This user must also own the server process. ::::::::::::::::::::::::::::::::::::::::::: WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: postgres -D /var/lib/pgsql/data or pg_ctl -D /var/lib/pgsql/data -l logfile start
Passaggio 3:
$ exit
Passaggio 4: Avvia il server PostgreSQL
# service postgresql start Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor Active: active (running) since Wed 2016-08-31 17:43:58 IST; 10s ago Process: 23144 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT Process: 23138 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code= Main PID: 23147 (postgres)
E secondo questo link, puoi ignorare il polkitd messaggio di errore.