Skip to content

Instantly share code, notes, and snippets.

@pharzan
Created September 28, 2017 07:43
Show Gist options
  • Save pharzan/18fcff5b2f24130893e76dedf023cf32 to your computer and use it in GitHub Desktop.
Save pharzan/18fcff5b2f24130893e76dedf023cf32 to your computer and use it in GitHub Desktop.
PostgreSQL won't start on Mint /var/run/postgresql/.s.PGSQL.5432
After installing postgreSQL and rebooting Mint when recieved I would recieve the following error saying can't start postgres
while trying to run Django
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain
socket “/var/run/postgresql/.s.PGSQL.5432”?
sudo mkdir /var/log/postgresql
sudo chown postgres.postgres /var/log/postgresql
sudo su postgres
touch /var/log/postgresql/postgresql-9.1-main.log
/etc/init.d/postgresql stop
/etc/init.d/postgresql start
the above solution was from:
https://6ftdan.com/danielpclark/2014/04/27/varrunpostgresql-s-pgsql-5432-with-a-virtual-var-folder/
To fix postgress for once an all:
cd /usr/share/postgresql-common
sudo pico init.d-function
find start(){
and add the following:
if [ -d "/var/log/postgresql"]; then
chmod 2775 /var/log/postgresql
else
mkdir -m 2775 -p /var/log/postgresql
touch /var/log/postgresql/postgresql-9.1-main.log
chmod 2666 /var/log/postgresql/postgresql-9.1-main.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment