0

I am running postgres 9.6 cluster on ubuntu 20.

All installation and starting the database is fine, however, I am experiencing a weird behavior.

In the pg_hba.conf file, I am trusting any connection from any user from the local host and it is working just fine when I start the cluster using the "pg_ctl start" utility.

enter image description here

However, when I start it from the systemd, systemctl start [email protected], it fails with the following error

enter image description here

Anyone has proper explanation for this difference in behaviour ?

asked Sep 1, 2022 at 11:47

1 Answer 1

1

Figured it why; When you use pg_ctl to stop/start your cluster, you define your data directory with -D argument.

However, when you start postgres with systemd 'systemctl stop/start <>', it fetch the configuration (postgresql.conf and pg_hba.conf) from /etc/postgresql/.... according to what is defined in the service definition in systemd.

That is what caused the difference in behaviour.

answered Sep 1, 2022 at 11:47
1
  • 1
    You should remove the configuration file that is wrong. That way, you will notice automatically if you try to start the server in the wrong way. Commented Sep 1, 2022 at 15:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.