-2

When I try to start my postgresql server on CentOS I get a message to say that it has failed to start it. I have made sure to initialise the db using "service postgresql initdb". Does anyone have any suggestions to fix this?

closed as unclear what you're asking by dr01, GAD3R, Archemar, Dmitry Grigoryev, Anthony Geoghegan Apr 24 '17 at 20:28

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Have you check in the logs for some clue? – Romeo Ninov Apr 24 '17 at 10:17
  • This was the error I found: < 2017-04-24 05:05:13.196 CDT > FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied < 2017-04-24 05:05:13.207 CDT > LOG: database system is shut down – Grant Apr 24 '17 at 11:28
  • Please check the permission of /tmp, it should be drwxrwxrwt – Romeo Ninov Apr 24 '17 at 11:33
  • When using "ls -ld /tmp" it stated the permission as drwxrwxr-t. Would this suggest the issue is elsewhere? – Grant Apr 24 '17 at 12:07
  • IMHO the problem is exactly there. You can try chmod 1777 /tmp and try again to start the service – Romeo Ninov Apr 24 '17 at 12:09
1

As per discussion in the comments you have problem with creating temporary file in /tmp:

< 2017-04-24 05:05:13.196 CDT > FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock"

and the permission of /tmp directory is wrong

When using "ls -ld /tmp" it stated the permission as drwxrwxr-t

so the solution is to change the permission of /tmp to make it writable for the World

chmod 1777 /tmp

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