Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!spectrix!clewis From: clewis@spectrix.UUCP (Chris Lewis) Newsgroups: comp.unix.wizards Subject: Re: Zombies ??? Message-ID: <263@spectrix.UUCP> Date: Tue, 9-Dec-86 12:50:25 EST Article-I.D.: spectrix.263 Posted: Tue Dec 9 12:50:25 1986 Date-Received: Tue, 9-Dec-86 17:49:35 EST References: <1327@brl-adm.ARPA> <165@hqda-ai.UUCP> Reply-To: clewis@spectrix.UUCP (Chris Lewis) Organization: Spectrix Microsystems Inc., Toronto, Ontario, Canada Lines: 65 In article <165@hqda-ai.UUCP> merlin@hqda-ai.UUCP (David S. Hayes) writes: >All processes ZOMBIE for a short time: the time between the process >exit and their parent's wait(). Processes that you see on ps(1) as >ZOMBIE are the result of the parent process exiting before the child, >or exiting without reading the child's exit status. When this >happens, he child (now considered an "orphan" process) becomes a child >of init (process 1). The kernel doesn't think about this, though, and >just ZOMBIE's the child as usual. Init, though, does not check the >exit status either. Close but not quite. >Thus, the ZOMBIEs stick around until reboot. Not true - normally. [Sort of reminds me of what somebody told one of our customers: "You should do a "ps-l" frequently. If you see the words "csh" that means the process has crashed, and you should issue a "kill -9 " to clear it".... Sigh... ] "init" is issuing "wait"'s continuously - that's how it figgers out that a login session has gone away. It has a loop something like this: /* fork/exec all getty's specified in /etc/ttys (or whatever) and remember their pids */ while(1) { pid = wait(&status); if (pid == one of the getty processes init spawned) fork/exec a new getty else /* ignore completely */ } Therefore, in a normally running system init will eventually "wait" for all processes that have died without their parent having waited for them, and all Zombies will disappear. Usually pretty quickly. Situations where Zombie processes stay around are: 1) init has died or hung (repeat by: "kill -9 1" [You hear the howling of the Banshee....]) 2) the process isn't totally dead. This can happen when the process is trying to die, but during attempts to close all of it's open devices, the driver hangs. Especially when a tty driver hangs in "close" because of some odd state - common in some earlier EXORmacs UNIX systems. Their not-quite-perfect tty driver and hardware would hang when a modem dropped the line - in this case, one "stuck" Zombie would prevent all other Zombies from being seen by init. If your system ever starts getting large numbers of Zombies that are staying around, first check to ensure that "init" is still running (process 1). If it ain't, it'll be a Zombie too - You MUST reboot your system to recover (tho, some systems autoreboot if init goes away - eg: Pyramids). Once init has gone away, no "new" getty's will be spawned until reboot. Otherwise, suspect devices associated with the Zombie processes. Until you have the "device hang" problem fixed you will always have to reboot to clear Zombies (if the number is increasing). Contact your support organization. -- Chris Lewis, Spectrix Microsystems Inc, UUCP: {utzoo|utcs|yetti|genat|seismo}!mnetor!spectrix!clewis ARPA: mnetor!spectrix!clewis@seismo.css.gov Phone: (416)-474-1955