1

I recently had to replace my postgresql.conf file, and I thought I got the settings right, but when I try to run Postgresql, I get this error:

 ESTFATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory 

My workaround is to go as root and create a folder called postgresql in /var/run and then change the owner of the folder to postgres.

The biggest problem is that I need to do this every single time my computer starts, the folder somehow deletes itself.

I tried commenting out the external pid file bit in the conf file, but that didn't change anything.

2
  • Which distro are you running? Post the init script /etc/init.d/postgresql? Commented Nov 14, 2011 at 16:01
  • I am running Ubuntu, the init script is the one that comes with postgresql, Postgresql used to run on startup, but now it doesn't. I am guessing that the script encounters the same error as above. Where can I go and check startup errors? Commented Nov 14, 2011 at 18:03

1 Answer 1

1
  • What version of postgresql are you running?
  • What repo is it from?
  • Can you post your config file and init script?

I tried commenting out the external pid file bit in the conf file, but that didn't change anything.

Try having it write the pid file out to /var/run/FILE instead of /var/run/postgresql/FILE.

[Edit 1]:

The default socket directories for apps are usually /tmp as it's world writable (which var isn't, of course creating the directory and setting permissions allows this to work, it's rather non-standard and might be better using the standard settings). Also, I'd leave the extra pid line commented out since the init script doesn't use it.

2
  • I am running PG 9.1. I seem to have fixed it for the time being. In the conf file, I changed the location of the socket and the pid file from /var/run/postgresql to /var/postgresql. I made the directory postgresql, and set it's owner to postgres. But, if you are still curious, here is the config file and here is the init.d script. Commented Nov 15, 2011 at 15:23
  • See [Edit 1] above. Commented Nov 15, 2011 at 17:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.