Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to find out which process is listening to which port

47 views
Skip to first unread message

newa

unread,
Apr 7, 2008, 3:30:34 PM4/7/08
to
Hi,

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?

Thanks a lot in advance.

Rick Jones

unread,
Apr 7, 2008, 4:10:49 PM4/7/08
to

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...

0 new messages