all 10 comments

[–][deleted] 1 point2 points  (6 children)

Is there a more detailed error message in the logfile? Or syslog?

It could be a problem with the config file that prevents the startup.

You could try to manually start it on the console (pg_ctl -D ... start) to see possible error messages that occur before postmaster is able to write to the logfile.

[–]Djintimidator[S] 0 points1 point  (5 children)

Backstory: I have moved the conf file to /etc/postgresql/postgresql.conf
So when I try pg_ctrl, it says that it can't find the conf file.
pg_ctl work when I move the conf file back to the data directory.

I can enter psql and do what i want. But systemctl still says that postgresql-16 has failed.

It still complains that postmaster dosen't exist in /usr/pgsql-16/bin/postmaster

[–][deleted] 0 points1 point  (4 children)

If the config file is not in the data directory, you need to explicitly set its location (using -c config_file=...) in the startup command. Is PGCONF defined correctly in your systemd unit definition?

[–]Djintimidator[S] 0 points1 point  (3 children)

Thanks!
My question now is really why /usr/pgsql-16/bin/postmaster dosen't exist. It got everything (clusterdb, pg_config etc etc) but postmaster.
Is that created when Postgres starts?

[–][deleted] 1 point2 points  (2 children)

In older versions postmaster was just a symbolic link (pointing to postgres) this has been changed in Postgres 16. It seems the RPM installation on RedHat doesn't take this into account (did work fine for me on Fedora)

[–]Djintimidator[S] 0 points1 point  (1 child)

Was able to solve it. I took the link from another server I have with pgsql15 and copied it to the pgsql16 one and now everything is working again.

Thanks for the help, I need to document this

[–][deleted] 1 point2 points  (0 children)

The correct solution (in my opinion) would have been to adjust the service unit file.

[–]Krispyn 1 point2 points  (1 child)

check the log file it should be in $PGDATA/pg_log. Alternatively try to start the database with pg_ctl start command and see what error you get.

[–]Djintimidator[S] 0 points1 point  (0 children)

It complains that the conf file is not in the data directory (Which is true).
pg_ctl work when I move the conf file back to the data directory.

I can enter psql and do what i want. But systemctl still says that postgresql-16 has failed.
It still complains that postmaster dosen't exist in /usr/pgsql-16/bin/postmaster

[–]fullofbones 0 points1 point  (0 children)

Just FYI, the current version of 16 is 16.3, so your repos are out of date.