Pragnesh
Pragnesh

Reputation: 41

Postgres service doesnot start

I have issue with postgres. It stops due to change in pg_hba.conf file

Actually my postgres was not connect with PHP

So I change in method in /var/lib/pgsql/data/pg_hba.conf file:

TYPE     DATABASE           USER            ADDRESS                 METHOD
host       all              all             127.0.0.1/32            ident

In order to solve my connection error i change the method ident to trust and postgresql servicer stops

I rollback my changes even it not started.

The error is:

LOG: could not open configuration file "/var/lib/pgsql/9.4/data/pg_hba.conf": Permission denied

Upvotes: 3

Views: 4325

Answers (1)

user_0
user_0

Reputation: 3363

I'm assuming that postgresql is running with postgres user, as in a standard configuration.

From terminal, as root:

ls -l /var/lib/pgsql/9.3/data/pg_hba.conf

And verify the owner. If the owner is not postgres:

chown postgres:postgres pg_hba.conf

And be sure it has permission to read and write:

chmod u+rwx pg_hba.conf

Upvotes: 5

Related Questions