View Single Post

   
  #2 (permalink)  
Old 04-07-2008, 08:25 PM
Rick Jones
 
Posts: n/a
Default Re: how to find out which process is listening to which port

newa <DavidLLiu1@gmail.com> wrote:
> On HP-UX I am trying to determine the process name/id that is bound
> to a particular port. On linux I can use "netstat -ap" but on hp-ux
> "netstat -p" means differently. The HP site suggested to use lsof
> but its binary is outdated on the box that I am on (lsof: WARNING:
> compiled for HP-UX release B.11.11; this is B.11.23...)


> So are there any other ways to do this on HP-UX?


There may be some ways to use pstat() calls - that is probably what
lsof is doing. You should simply get an 11.23 lsof binary - perhaps
via http://hpux.connect.org.uk/

What is leading you to want to do this? Trouble restarting a server
on a "well-known" port? If so, then you should not need to find an
offending pid unless it has a socket bound to that port number and in
the LISTEN state (assuming TCP) unless your server code isn't setting
SO_REUSEADDR before trying to bind().

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Reply With Quote