From owner-freebsd-questions Wed Jun 19 6: 0:32 2002 Delivered-To: freebsd-questions@freebsd.org Received: from apache.metrocom.ru (www.metrocom.ru [195.5.128.139]) by hub.freebsd.org (Postfix) with ESMTP id BC38137B406 for ; Wed, 19 Jun 2002 06:00:04 -0700 (PDT) Received: from apache.metrocom.ru (apache.metrocom.ru [195.5.128.150]) by apache.metrocom.ru (8.12.3/8.12.3) with ESMTP id g5JCqLvJ019068; Wed, 19 Jun 2002 16:52:21 +0400 (MSD) Date: Wed, 19 Jun 2002 16:52:21 +0400 (MSD) From: Varshavchick Alexander To: Giorgos Keramidas Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Getting pid of listening process In-Reply-To: <20020619121702.GB45894@hades.hell.gr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG yes, sockstat works, however not expecially fast, but it seems to solve the matter. I don't know why lsof hangs but considering sockstat working it's not important. Thanks for helping. Alexander Varshavchick, Metrocom Joint Stock Company Phone: (812)118-3322, 118-3115(fax) On Wed, 19 Jun 2002, Giorgos Keramidas wrote: > Date: Wed, 19 Jun 2002 15:17:02 +0300 > From: Giorgos Keramidas > To: Varshavchick Alexander > Cc: freebsd-questions@FreeBSD.ORG > Subject: Re: Getting pid of listening process > > On 2002-06-19 11:37 +0000, Varshavchick Alexander wrote: > > Hi gurus, > > > > can anybody make a hint as how pid of a process listening on a specified > > tcp port can be determined? > > $ sockstat -l4 | grep ':25 ' | awk '{print $3}' > 21401 > 493 > > $ ps xa | grep 21401 | grep -v grep > 21401 ?? Ss 0:06.14 sendmail: accepting connections (sendmail) > > $ ps xa | grep 493 | grep -v grep > 493 ?? Ss 0:09.91 sendmail: accepting connections (sendmail) > > - Giorgos > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message