0

I have installed Postgres-11 on a host of RedHat Linux 7, and it had been initialized and started OK.

Then I added listen_addresses = '*' into the configuration file at /var/lib/pgsql/11/data/pg_hba.conf, hoping to let Postgres listen on a non-local interface. However, when trying to restart Postgres by command systemctl restart postgresql-11, it always gets the below error about "Unregistered Authentication Agent".

I tried to remove listen_addresses = '*' and everything went back to normal again.

Not sure what is wrong here, and any hints will be highly appreciated.

Aug 10 17:45:50 payv.local.example.com polkitd[697]: Registered Authentication Agent for unix-process:20400:1691804 (system bus name :1.49 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object
Aug 10 17:45:50 payv.local.example.com systemd[1]: Starting PostgreSQL 11 database server...
-- Subject: Unit postgresql-11.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-11.service has begun starting up.
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.584 MDT [20413] LOG:  listening on IPv4 address "127.0.0.1", port 5432
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.588 MDT [20413] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.593 MDT [20413] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.600 MDT [20413] LOG:  redirecting log output to logging collector process
Aug 10 17:45:50 payv.local.example.com postmaster[20413]: 2021-08-10 17:45:50.600 MDT [20413] HINT:  Future log output will appear in directory "log".
Aug 10 17:45:50 payv.local.example.com systemd[1]: postgresql-11.service: main process exited, code=exited, status=1/FAILURE
Aug 10 17:45:50 payv.local.example.com systemd[1]: Failed to start PostgreSQL 11 database server.
-- Subject: Unit postgresql-11.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-11.service has failed.
--
-- The result is failed.
Aug 10 17:45:50 payv.local.example.com systemd[1]: Unit postgresql-11.service entered failed state.
Aug 10 17:45:50 payv.local.example.com systemd[1]: postgresql-11.service failed.
Aug 10 17:45:50 payv.local.example.com polkitd[697]: Unregistered Authentication Agent for unix-process:20400:1691804 (system bus name :1.49, object path /org/freedesktop/PolicyKit1/Authenticat
2
  • Looks to me like SELinux doesn't like you listening on '*'. Either disable it, or figure out how to change its mind.
    – jjanes
    Commented Aug 11, 2021 at 3:11
  • Check the log output in the logfile, but most likely it complains about a syntax error in your hba file (as the option is misplaced). Also check journalctl for unrelated (SELinux) errors.
    – eckes
    Commented Aug 11, 2021 at 5:59

1 Answer 1

2

pg_hba.conf is the wrong file. listen_addresses has to be specified in postgresql.conf.

1
  • Yes, I've verified that postgresql.conf is the correct file to change.
    – James
    Commented Aug 11, 2021 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.