T.R | Title | User | Personal Name | Date | Lines |
---|
8601.1 | | SMURF::MENNER | it's just a box of Pax.. | Mon Jan 27 1997 13:19 | 6 |
| A sockets are not directly connected to pseudo terminals. The marriage
happens in user space by a controlling process (e.g., telnetd) which
has both a network stream (i.e., a socket open) and a master pty.
The process reads from the socket and writes to the master (and
vide versa). Finding which process has the socket and which has
what master pty is non trival.
|
8601.2 | File usage available, how bout the socket? | MARVIN::GOUGH | Raoul Gough | Mon Jan 27 1997 14:38 | 11 |
|
Thanks for the response,
<<< Note 8601.1 by SMURF::MENNER "it's just a box of Pax.." >>>
I've tried using fuser.c (see note 4183.2), which can identify the processes
using the /dev/ttyp.. pseudo device. Is there any way to see the PIDs using
a socket? I've got a bad feeling that it's one of those "Use kdbx" things.
Thanks,
Ray.
|
8601.3 | | KITCHE::schott | Eric R. Schott USG Product Management | Mon Jan 27 1997 17:27 | 4 |
| lsof ?
http://www-unix.zk3.dec.com/tuning/tools/tools.html
|
8601.4 | lsof is cool | MARVIN::GOUGH | Raoul Gough | Tue Jan 28 1997 04:51 | 19 |
|
Re:<<< Note 8601.3 by KITCHE::schott "Eric R. Schott USG Product Management" >>>
Thanks Eric,
lsof does the job alright. The only tricky bit is finding the controlling
process on the ttyp.. device and then looking at all the other files that the
process also has open.
More than one of them (?) is the socket connection, which is nicely listed
with it's remote end identified. Might be more than one copy of the socket
because the xterm has done some dup(2) with it or something.
Anyway, lsof does just what I wanted.
Regards,
Ray.
|
8601.5 | What about finger | NETRIX::"[email protected]" | marvin::gough | Tue Feb 11 1997 11:57 | 17 |
|
Well, I should probably have entered the request in a unix_beginners
conference, because finger gives me the information I wanted:
$ finger gough
Login name: gough In real life: Ray Gough
Directory: /usr/users/gough Shell: /usr/bin/ksh
On since Feb 11 10:20:07
on ttyr1 from andmen
No Plan.
It doesn't say which socket from the remote host, but at least it gives
the host name.
Apologies for the mis-posting,
Ray
[Posted by WWW Notes gateway]
|