We've been having problems with processes which apparently lose their
controlling tty but who keep that tty open. (This is on a Sun 670
running SunOS 4.1.2.) The symptoms are these. When trying to telnet
into this machine, the login: prompt will be displayed for a short
time (around a second) but then the connection will be mysteriously
closed. When trying to rlogin to this machine it's even more wacky.
I can rlogin to it, and have all my stuff in my .bash_profile run Ok,
but then when that finishes, the shell echoes "logout" and the
connection is closed.
Apparently, telnetd and rlogind are getting EOF (telnetd when it's
trying to read the login name and rlogind after it runs my shell). We
can trace the problem to the fact that there are processes running
which, for some reason, have the "next available" tty open, so that
when telnetd/rlogind open these tty's, the open succeeds but then when
they try to read from such a tty, they get EOF. The "offending
programs" vary. Sometimes it's mailers (elm, pine, /usr/ucb/mail),
but that's probably because one of the primary uses of this machine is
email. One time it was even lpr, just sitting there with no
controlling tty but yet with a tty open. Needless to say, it's a pain
to have to remotely find out what the offending process is with
rsh/lsof/ps and then go kill it.
Does anybody have an explanation or maybe even a solution to this
problem? Thanks in advance.