1
votes

I´ve read many similar forum discussions about this but I have not been able to solve the problem. I installed postgresql 9.1 on ubuntu 12.04 (not really a server machine, but virtualized in VirtualBox). Yesterday I was able to restart (and start) postgresql server but not today after many trials.

In postgresql.conf i have listen_addresses='*' and port=5432 and unix_socket_directory = 'var/run/postgresql'

I´ve looked into that directory but it seems to be empty.

I´ve tried: locate PGSQL.5432 but there´s no results

My server ip is set like 192.168.1.211 and ping -c 4 192.168.1.211 seems to be ok.

Tried many solutions (like chmod 777 /var/run/postgresql) and nothing seems to fix it.

It´s maybe and stupid issue and I´m not being able to solve it as i don´t have a high level of knowledge on those systems.

Full error messages: after sudo service postgresql restart -- > The postgresql server failed to start. Please check the log output. After sudo psql -- > could not connect to server: the file or directory does´nt exist. Is the server running locally and accepting connections on Unix domain socke "var/run/postgresql/.s.PGSQL.5432?

Postgresql version: 9.1

Just after starting ubuntu, this is the log that i get with tail /var/log/postgresql/postgresql-9.1-main.log:

CET LOG: could not open temporary statistics file "pg_stat_tmp/pgstat.tmp": permission denied.

CET LOG: received smart shutdown request

CET LOG: autovacuum launcher shutting down.

CET LOG: shutting down

CET PANIC: could not open control file "global/pg_control": permission denied

CET LOG: background writer process (PID 7151) was terminated by signal 6: Aborted

CET LOG: terminating any other active server processes

CET LOG: could not open temporary statistics file "pg_stat_tmp/pgstat.tmp": permission denied.

CET LOG: abnormal database systema shutdown.

Any idea about what to try?

3
The postgresql server failed to start. Please check the log output Did you check the log output? What did it say?wildplasser
Hi, I´ve edited the post adding more information and the log output. ThanksCesar

3 Answers

3
votes

Here the solution I´ve found, hope could help other users with similar issue:

I´ve just made:

sudo chown -R postgres:postgres /var/lib/postgresql

And now postgresql is starting fine. So wrong permissions, maybe modified by myself, I´m not sure.

Kind regards.

0
votes

I faced the same issue, this was solved after making the changes in the postgresql.conf i.e.

listen_addresses='*'

And restarted the device it was solved,for more detail use the below given link, Restart the device after making changes in the config file it solves most of the firewall issues.

Help

0
votes

This error generally means that the server is not running. Based on dpkg -l output and the thread of comments, it was due to the postgresql-9.5 main package being somehow uninstalled. Since the uninstall hasn't been called with the --purge option to dpkg, the data and configuration files are still there, so apt-get install postgresql-9.5 can fix the problem.