Forum OpenACS Q&A: PostgreSQL Fatal Error

Collapse
Posted by Luis Garcia on

I installed Postgre and all went fine until I got to create plpgsql. This is the error I get in the console:

postgres@linux:~> createlang plpgsql template1

psql: could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

createlang: external error

This is the error I get in the log file:

FATAL: Can't read lock file /tmp/.s.PGSQL.5432.lock: Permission denied

Before that I had done:

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start

and I got the exact same answers you guys show there in the docs...

Thanks!

Collapse
2: Re: PostgreSQL Fatal Error (response to 1)
Posted by Steve Manning on
Luis

Either your server isn't running ('pidof postmaster' as root should show you that) or you have a permissions issue.

Check the log file in /usr/local/pgsql/data/server.log and see if it gives any clues.

Also you could try skipping ahead and setting up the service (.../init.d/postgeresql) and restarting pg under that as I've had weird permissions problems starting from the command line in the past.

- Steve

Collapse
3: Re: PostgreSQL Fatal Error (response to 1)
Posted by Luis Garcia on

Already checked the error log file. This is what I get. In fact, that is the only line there is in that file.

FATAL: Can't read lock file /tmp/.s.PGSQL.5432.lock: Permission denied

I have the feeling that is the problem as well, I just don't know how to solve it. As I understand user postgre has to have permit to run as a service. How do I check that? Or change that in any case.

Thanks!

Collapse
4: Re: PostgreSQL Fatal Error (response to 1)
Posted by Luis Garcia on

I tried Steve's suggestion. I went ahead anyway and set it up to start as a service and it did not work...

I still get the same error both in the console and in the error log file...

This is exactly what I was talking about here:
https://openacs.org/forums/message-view?message%5fid=252336

Anyway, hope some one can give me a hint. There is something that always fails during install. This one had never failed. So, I guess there is always a first.

Collapse
5: Re: PostgreSQL Fatal Error (response to 1)
Posted by Don Baccus on
You have a permissions problem.

What are the permissions on /tmp? (ls -ld /tmp)

Does the lock file exist? If so, what are the permissions on .s.PGSQL.5432? (ls -l /tmp/.s.PGSQL.5432).

Collapse
6: Re: PostgreSQL Fatal Error (response to 1)
Posted by Luis Garcia on

Hi Don,

Thanks! I realized that this morning. Worked on it and did not work. The problem actually was that the file was corrupted. I deleted it and let postgre create another one during start up. That was it! It worked!

thanks again!