Re: [GENERAL] Unable to start postgresql - Mailing list pgsql-general

From John Iliffe
Subject Re: [GENERAL] Unable to start postgresql
Date
Msg-id 201703090009.00637.john.iliffe@iliffe.ca
Whole thread Raw
In response to Re: [GENERAL] Unable to start postgresql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] Unable to start postgresql
List pgsql-general
On Wednesday 08 March 2017 23:35:10 Tom Lane wrote:
> John Iliffe <john.iliffe@iliffe.ca> writes:
> > [root@prod04 John]# lsof -n | grep postmaster
> > [root@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@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





pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] count case when - PG 9.2
Next
From: hariprasath nallasamy
Date:
Subject: Re: [GENERAL] too may LWLocks