[comp.unix.wizards] Zombie Processes

worms-emh1.army.mil>@adm.BRL.MIL (12/06/88)

I am running UNIX System V on a Unisys (Sperry) 5000/80 series mini, and
am currently functioning as a sub-host to a DDN node running MMDF II.
Our connection to the host is via a point-to-point 9600 bps short-haul modem
connection.  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.

I have only been working with UNIX based systems for a few months and have
not seen this particular problem before.  If anyone has encountered this
problem before either with MMDF or any other process and can offer any advice
as to how the getty can be killed short of a reboot, or how to stop this from
happening in the first place, it would help a great deal.  The host supports
too many other users to reboot just for us.

SSG W.D. Calhoun
System Administrator (In Training?)
32nd Support Command (AD)
Worms, FRG

gregg@ihlpb.ATT.COM (Wonderly) (12/07/88)

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 <stdio.h>
#include <sys/types.h>
#include <sys/termio.h>

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