From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 111731,d4c1f7c0fe672a4 X-Google-Attributes: gid111731,public From: Elias Martenson Subject: Re: Different UNIX pro's and con's. Date: 1998/09/16 Message-ID: #1/1 X-Deja-AN: 391656104 References: <35F71814.1E0B911C@iakom.com> <35FA667E.149C22CC@home.com> <1998Sep12.202540.28255@lorelei.approve.se> <35FB1422.DAEB153D@home.com> <1998Sep13.165009.5046@lorelei.approve.se> <35FDE4C4.83878B2A@home.com> <1998Sep15.091210@netman.eng.auburn.edu> <35FEFF23.605954B0@home.com> Organization: Sun Microsystems Newsgroups: comp.unix.advocacy,comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec "Rev. Don Kool" writes: > Doug Hughes wrote: > > > > You can't kill defunct processes. They only go away with a reboot. > > > No!! You can keep repeating this, but it is NOT true. You kill a defunct > > process by killing its parent application. If the parent application happens > > to be init, then you've got a problem that needs a patch. > > Hold off on clearing the processes for a few months until such time > (if ever) that the patch is released? How convenient. Let me try to clear things up for you. A "defunct" or "zombie" process is a slot in the process table that is left behind when a process exits. As you know, all processes exit with an exit code (the argument to the exit(2) system call), this exit code in written into a slot in the process' entry in the process table. Therefore, the slot has to be "active" until the parent process has read this status code (the wait(2) system call). If the parent process never reads this status code the zombie process will linger until the parent process dies. Why? Because when a parent process dies, the children are inherited by "init" (pid 1), "init" sees that it's got a new child which happens to have died (i.e, it's a zombie) and "init" does the wait(2) on behalf of the parent process that dies before reading the status code. That is why you can get rid of the zombie processes by killing the parent process. What Doug said, was that if you still get zombie processes, after killing the parent (i.e, "init" inherits the zombie process without reaping it's status code) then that's a bug in the OS. That's the patch Doug was referring to. I'm not aware of any such bugs in any of the Unices I've worked with. I hope you understand what zombie processes are all about now, and that you won't have to reboot you system to get rid of them again. Hope this helps, -- Elias Martenson elias.martenson (atsign) sweden.sun.com