how to find out which process is listening to which port - HP UX

This is a discussion on how to find out which process is listening to which port - HP UX ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: how to find out which process is listening to which port

  1. how to find out which process is listening to which port

    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.


  2. Re: how to find out which process is listening to which port

    newa 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 to Thread