Path: utzoo!utgpu!watmath!clyde!att!ihlpb!gregg
From: gregg@ihlpb.ATT.COM (Wonderly)
Newsgroups: comp.unix.wizards
Subject: Re: Zombie Processes
Message-ID: <9151@ihlpb.ATT.COM>
Date: 6 Dec 88 16:07:31 GMT
References: <17712@adm.BRL.MIL>
Organization: AT&T Bell Laboratories - Naperville, Illinois
Lines: 59

From article <17712@adm.BRL.MIL>, by worms-emh1.army.mil>@adm.BRL.MIL:
> I am running UNIX System V on a Unisys (Sperry) 5000/80 series mini, and
> ...
> Periodically, and with no discernable pattern, the getty running
> on the host system will lock up and not respond to our attempts to connect,
> either via the MMDF II deliver daemon or the CU command.  When this happens,
> nothing short of rebooting the host system seems to be able to kill the
> process.

Problems with SYS5 tty ports, like this, are usually solved with the TCFLSH
ioctl.  TCFLSH will wake the process so that it can die.

Below is a program which exercises TCFLSH on the files given on the command
line.  Use "flush /dev/ttyxxxx" to flush ttyxxxx.

========  flush.c  =======
#include 
#include 
#include 

main (argc, argv)
	int argc;
	char **argv;
{
	int fd, i;

	if (argc < 2) {
		fprintf (stderr, "usage: %s tty-devs\n", argv[0]);
		exit (1);
	}

	/*  Process each of the tty devices given.  */

	for (i = 1; i < argc; ++i) {

		/*  Open a file to the device.  */

		if ((fd = open (argv[i], 2)) == -1) {
			perror (argv[1]);
			exit (1);
		}

		/*
		 *  Flush the terminal, as a side effect, sleeping processes
		 *	will be woke up.
		 */

		if (ioctl (fd, TCFLSH, 0) == -1) {
			perror ("TCFLSH");
			exit (1);
		}
		close (fd);
	}

	return (0);
}
-- 
It isn't the DREAM that NASA's missing...  DOMAIN: gregg@ihlpb.att.com
It's a direction!                          UUCP:   att!ihlpb!gregg