Re: Unable to start postgresql

From: John Iliffe <john(dot)iliffe(at)iliffe(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unable to start postgresql
Date: 2017-03-09 05:09:00
Message-ID: 201703090009.00637.john.iliffe@iliffe.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 08 March 2017 23:35:10 Tom Lane wrote:
> John Iliffe <john(dot)iliffe(at)iliffe(dot)ca> writes:
> > [root(at)prod04 John]# lsof -n | grep postmaster
> > [root(at)prod04 John]# lsof -n | grep postgres | grep 5432
> > postgres 2760 postgres 5u unix 0xffff9e5390b5b800
> > 0t0
> >
> > 69422 /tmp/.s.PGSQL.5432 type=STREAM
>
> That isn't proving a lot: as I showed in my example lsof output,
> Fedora's lsof will map "5432" to "postgres" in the context of an IP
> port number. (I'm sure there's a way to turn that off, but -n ain't
> it.)
>
> regards, tom lane

Yes, but your lsof output also showed a line for postmaster and mine
doesn't. In your case postmaster has an IPv6 TCP socket (but no IPv4 I
notice) whereas mine has neither.

The postgres output seems to be equivalent.

As for lsof, I have searched the man page to try and find appropriate
parameters for when all I want to know about is IP sockets but to date no
joy.

The following is from ss, the new version of netstat:

------------------------------------
tcp LISTEN 0 128 127.0.0.1:postgres *:*
tcp LISTEN 0 128 ::1:postgres :::*
------------------------------------

Unfortunately a request to resolve the socket numbers (ss -rl) fails.

What I was able to get is the SELinux context of these sockets but frankly,
it means nothing to me at his point. With SELinux in permissive mode it
shouldn't be relevant, but just in case it helps you, here it is:

---------------------------------------
[root(at)prod04 John]# ss -aZ | grep post
u_str LISTEN 0 128 /tmp/.s.PGSQL.5432 69422 *
0 users:
(("postgres",pid=2760,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=5))
udp ESTAB 0 0 ::1:49481 ::1:49481
users:
(("postgres",pid=2766,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8),
("postgres",pid=2765,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8),
("postgres",pid=2764,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8),
("postgres",pid=2763,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8),
("postgres",pid=2762,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8),
("postgres",pid=2760,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=8))
tcp LISTEN 0 128 127.0.0.1:postgres *:*
users:
(("postgres",pid=2760,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=4))
tcp LISTEN 0 128 ::1:postgres :::*
users:
(("postgres",pid=2760,proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-
s0:c0.c1023,fd=3))
-------------------------------------------

Regards,

John

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hariprasath nallasamy 2017-03-09 05:25:36 Re: too may LWLocks
Previous Message David G. Johnston 2017-03-09 05:02:40 Re: count case when - PG 9.2