Zombie Processes
Wonderly
gregg at ihlpb.ATT.COM
Wed Dec 7 02:07:31 AEST 1988
>From article <17712 at 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 at ihlpb.att.com
It's a direction! UUCP: att!ihlpb!gregg
More information about the Comp.unix.wizards
mailing list