What process owns a socket? - Unix

This is a discussion on What process owns a socket? - Unix ; If I type: % netstat -a I can tell that some process is listening on port tcp 1521 (Oracle). I can confirm that by telneting from another host into that port. Now, comes the estrange part. I run the Oracle ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: What process owns a socket?

  1. What process owns a socket?


    If I type:

    % netstat -a

    I can tell that some process is listening on port tcp 1521 (Oracle). I
    can confirm that by telneting from another host into that port.

    Now, comes the estrange part. I run the Oracle utility "lsnrctl" and
    presumably stop the listener BUT netstat still shows that somebody is
    listening in port 1531 and still can telnet into that port.

    The question is: how do I determine what process is listening o a
    given port?

    TIA,

    -Ramon F Herrera


  2. Re: What process owns a socket?

    "Ramon F Herrera" writes:

    > The question is: how do I determine what process is listening o a
    > given port?


    Install lsof.

    It's a command line utility that does what you want.

    --
    Todd H.
    http://www.toddh.net/

  3. Re: What process owns a socket?

    In article <84zm7st1q5.fsf@ripco.com>, comphelp@toddh.net (Todd H.)
    wrote:

    > "Ramon F Herrera" writes:
    >
    > > The question is: how do I determine what process is listening o a
    > > given port?

    >
    > Install lsof.
    >
    > It's a command line utility that does what you want.


    On some versions of Unix or Linux the -p option to netstat will show the
    owning process.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

  4. Re: What process owns a socket?

    Barry Margolin wrote:
    >In article <84zm7st1q5.fsf@ripco.com>, comphelp@toddh.net (Todd H.)
    >wrote:
    >
    >> "Ramon F Herrera" writes:
    >>
    >> > The question is: how do I determine what process is listening o a
    >> > given port?

    >>
    >> Install lsof.
    >>
    >> It's a command line utility that does what you want.

    >
    >On some versions of Unix or Linux the -p option to netstat will show the
    >owning process.


    On FreeBSD you can use sockstat.

    --gregbo
    gds at best dot com

+ Reply to Thread