Path: utzoo!attcan!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!mips!daver!lynx!blanier From: blanier@lynx.uucp (Brian Lanier) Newsgroups: comp.unix.questions Subject: Re: How to clean out Zombies? Summary: Zombies Message-ID: <7895@lynx.UUCP> Date: 21 Jul 90 05:43:38 GMT References: <24986.26a58a7a@kuhub.cc.ukans.edu> Reply-To: blanier@lynx.UUCP (Brian Lanier) Organization: Lynx Real-Time Systems Inc, Campbell CA Lines: 37 In article <24986.26a58a7a@kuhub.cc.ukans.edu> jian@kuhub.cc.ukans.edu writes: >Help Wanted: > > I am writting a program that works like a daemon process. The master ...DELETED... >call signal is received. Here is the problem. When I use "ps ux" shell >command to check the status of processes on the system, I found lots of >Zombie processes. If I terminate the master process, all of zombies are gone. The problem is that no one is collecting the exit status of the children, so they just hang out. Init will fix 'em when they become init's children (i.e. when "Master" dies). Try including this is the "Master" for a fix: #include #include catcher() /* for zombies */ { union wait status; wait3 (&status,WNOHANG,0); /* plain wait will work, too */ } main() { ...[misc. code]... signal(SIGCHLD,catcher); ...[more misc. code]... } > >Thanks in advance. No Prob, Hope this helps. > >Jian Q. Li >jian@kuhub.cc.ukans.edu