Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 368487

Summary: A server is already listening on:/var/run/postgresql/.s.PGSQL.5432
Product: Gentoo Linux Reporter: Linda <douganla>
Component: [OLD] ServerAssignee: PgSQL Bugs <pgsql-bugs>
Status: RESOLVED CANTFIX    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Linda 2011-05-23 19:27:20 UTC
I upgraded to postgresql-server-9.0.3-r3 on a gentoo server. When trying to start postgres server I am getting this error:

 # /etc/init.d/postgresql-9.0 start
 * Socket conflict.
 * A server is already listening on:
 *     /var/run/postgresql/.s.PGSQL.5432
 * HINT: Change PGPORT to listen on a different socket.

I checked and I cannot find anything listening on this port.

I have tried changing PGPORT to 5433 and the server starts but then when I try to log into the server I get this:

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

If I log in specifying the port I can log in:

 $ psql --port 5433 postgres
Password:
psql (8.4.7, server 9.0.3)
WARNING: psql version 8.4, server version 9.0.
         Some psql features might not work.
Type "help" for help.

postgres=#

I am just not sure of what the fix is for this. How do I get it to use port 5433 when logging into the database? Or is changing the port to 5433 not the correct thing to do? Please help, any help would be greatly appreciated.

Reproducible: Always
Comment 1 Aaron W. Swenson gentoo-dev 2011-05-23 21:24:22 UTC
There really isn't any good reason for there a server to be listening on /var/run/postgresql/.s.PGSQL.5432 unless the server shutdown really uncleanly.

So, the only thing that stands to reason is that you still have a server listening there.

What's the output of:

/etc/init.d/postgresql-8.4 status
Comment 2 Linda 2011-05-24 12:00:59 UTC
 (In reply to comment #1)
> There really isn't any good reason for there a server to be listening on
> /var/run/postgresql/.s.PGSQL.5432 unless the server shutdown really uncleanly.
> So, the only thing that stands to reason is that you still have a server
> listening there.
> What's the output of:
> /etc/init.d/postgresql-8.4 status



This is the output of /etc/init.d/postgresql-8.4 status

# /etc/init.d/postgresql-8.4 status
 * status:  stopped
 * Reloading PostgreSQL configuration ...
pg_ctl: no server running
Comment 3 Linda 2011-05-24 20:08:22 UTC
I figured out the solution.

Look for .s.PGSQL.5432 in /var/run/postgresql/
ls /var/run/postgresql/.s.PGSQL.5432

Then delete it
rm /var/run/postgresql/.s.PGSQL.5432 

and then start server
Comment 4 Aaron W. Swenson gentoo-dev 2011-05-27 19:25:44 UTC
Can't troubleshoot this any further then.