0

I have a postresql-9.3 installation which I have been running successful for over a year on a CentOS 6.8 system. While attempting to get phpPgAdmin setup (getting tired of using pgsql for everything) I must have made a change to my configuration files the system didn't like. When I try to start postgres it simply says [Failed] and the pgstartup.log file says the following...

LOG:  could not open configuration file "/var/lib/pgsql/9.3/data/postgresql.conf": Permission denied
FATAL:  configuration file "/var/lib/pgsql/9.3/data/postgresql.conf" contains errors

I have checked that the postgres user owns the config file, so I don't know why I'm getting that error. I didn't change that. The thing I need help with is the "contains errors" part. How do I tell what the errors are? While I didn't change anything in postresql.conf, I know it includes pg_hba.conf which I did change in an attempt to make phpPgAdmin work. Here is my pg_hba.conf file

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             postgres                                     trust

I have other lines for various access settings that I had been experimenting with, but they're all commented out. I've try using "*" for address and "all" for user and other variations but I keep getting the same error. I have not found any answers on google for such a vague log error. I have looked for a way to get the error to be more specific. If anyone knows how to do that I would be grateful. I am starting the database with "service postgresql-9.3 start" which is what I have always used.

Thanks for any advice.

  • Permission denied is the error. You need to check the ownership and permissions. But I do not see any evidence of those in your question. – Michael Hampton Feb 24 '17 at 13:49
  • Thank you Michael. Is this helpful? I just ran this command. [root@appreciateco ~]# ls -l /var/lib/pgsql/9.3/data/postgresql.conf -rw-rw----. 1 postgres postgres 20573 Feb 24 05:17 /var/lib/pgsql/9.3/data/postgresql.conf – SuperCatchyUsername Feb 24 '17 at 14:04
  • @MichaelHampton ok I ran chmod 777 var/lib/pgsql/9.3/data/postgresql.conf (just for temporary). Now the output is ls -l /var/lib/pgsql/9.3/data/postgresql.conf -rwxrwxrwx. 1 postgres postgres 20573 Feb 24 05:17 /var/lib/pgsql/9.3/data/postgresql.conf I ran the same command on pg_hba.conf for good measure. It's still not starting. – SuperCatchyUsername Feb 24 '17 at 14:16
  • Don't ever run chmod 777 on anything, for any reason, ever. Not even for "testing". – Michael Hampton Feb 24 '17 at 14:17
  • @MichaelHampton good advice, re: 777. The error output is more descriptive now. it's referencing the one uncommented line in pg_hba.conf. – SuperCatchyUsername Feb 24 '17 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.