[comp.sys.sun] hanging telnet, rlogin, clear_tty and 4.0.1

evan@ssyx.ucsc.edu (Evan Schaffer) (12/25/88)

We have an open service call to sun, working on this set of related
problems:

1. telnet to the 4.0 host closes immediately
2. telnet to the 4.0 host prints login: but is in cbreak mode;
	name^J yields passwd, but once logged in any char
	acts like ^D and logs you out
3. a sunview window disappears when the first char is typed
4. rlogin to the 4.0 hosts closes immediately

I suspect the problem is related to a combination of 4.0 and the nts-100
terminal servers and cisco gateway which share the local net. but i am
still clue-less. 

We're watching packets with a pc and netwatch, and i am hypothesizing that
the nts-100's don't release their pty after inactivity. Courtes of Barbara
Wright, here is clearutmp.c which prints the utmp readably without
arguments, and flushes utmp of ALL bogus entries with any argument:

#include <sys/time.h>
#include <utmp.h>
#define UTMP_MODE 0666

main(cnt, arg)
int cnt;
char *arg[];
{
	struct utmp U;
	struct tm *localtime(), *T;
	int fd, fo;

	if (--cnt)
		fo = creat("/etc/utmp.tmp", UTMP_MODE);
	fd = open ("/etc/utmp", 0);

	while(read(fd, &U, sizeof(U))) {

		T = localtime(&U.ut_time);

		printf("%8.8s\t%8.8s\t%6.6s\t%d/%d/%d\t%02d:%02d:%02d\n",
			U.ut_line,U.ut_name,U.ut_host,
			T->tm_mon+1, T->tm_mday, T->tm_year,
			T->tm_hour, T->tm_min, T->tm_sec);
		if (cnt)
			if (U.ut_name[0])
				write(fo, &U, sizeof(U));
	}
	close(fd);

	if (cnt) {
		close(fo);
		unlink("/etc/utmp");
		link("/etc/utmp.tmp", "/etc/utmp");
		chmod("/etc/utmp", UTMP_MODE);
		unlink("/etc/utmp.tmp");
	}
	exit(0);
}

mujica@cs.ucla.edu (S. Mujica) (01/05/89)

evan@ssyx (Evan Schaffer) writes:
>We have an open service call to sun, working on this set of related
>problems:
>
>1. telnet to the 4.0 host closes immediately
>2. telnet to the 4.0 host prints login: but is in cbreak mode;
>	name^J yields passwd, but once logged in any char
>	acts like ^D and logs you out
>3. a sunview window disappears when the first char is typed
>4. rlogin to the 4.0 hosts closes immediately

I Have experienced this problem in my machines (one Sun 3/280 and several
diskless workstations, no tty's attached except for one working as
console.)  I would doubt that the nts-100 terminal servers are the cause
(they might be one...)  I do not have any terminals connected to these
machines.

It seems that killing background processes that have open TCP connections
(like xbiff) cures the symptoms.  We have tried starting processes in the
background and then exiting, but this does not seem to create the problem
all the time consistently.

And yes,  it looks very much like pty's cannot be allocated.

You may have also e noticed that the connection breaks when you try to
start processes that require login like rlogin and telnet (for login).
However you can still rsh and telnet to other inetd services like time and
finger.

Any information on this will be greatly appreciated.

Sergio Mujica
Computer Science Department, UCLA
(213) 825-7276 825-3189

chris@gargoyle.uchicago.edu (Chris Johnston) (01/14/89)

I have seen the same thing on a 386i OS4.0.  I had etherd running in the
background on ttyp1.  using stty seemed to have no effect.  killing the
etherd process cleared everything up.  (Only took me about a week to guess
it was always the same pseudo terminal.)

So... If the pty won't leave raw mode get used to typing control-J and
kill that background process.

cj