From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230 X-Google-Attributes: gidfee84,public From: Ori Tzoran Subject: Re: Cannot kill processes Date: 1999/02/18 Message-ID: <36CC80E8.BE8049D5@netvision.net.il> X-Deja-AN: 445844405 References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> <36CAE18D.A8AE9476@brighttiger.com> To: Jeff Denham , "Sergey Yu. Bobrovnikov" X-Accept-Language: en,fr-FR Content-Type: multipart/alternative; boundary="------------3AC3A96E7B3DDD4D3F35E3EA" X-Complaints-To: abuse@netvision.net.il X-Trace: news.netvision.net.il 919371875 28468 62.0.176.208 (18 Feb 1999 21:04:35 GMT) Organization: NetVision Israel Mime-Version: 1.0 NNTP-Posting-Date: 18 Feb 1999 21:04:35 GMT Newsgroups: comp.unix.osf.osf1 --------------3AC3A96E7B3DDD4D3F35E3EA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit both postings from Sergey and Jeff are missing the point. the answer is simple: when a parent forks a child, the child does an exit (for whatever reason, this may also be an abnormal exit) but the parent doesn't wait(2) on it, the kernel holds the accounting information for the child. as soon as the parent do one of the wait variants, the kernel releases the PCB for the child and you wont see the defunct anymore. a defunct is not annoying so much, it doesn't take system resources, except for a slot in the (limited) array of tasks. if you encounter a pbl with "no more processes", max_task is reached. you can work around that by setting maxusers higher and wait for your vendor to fix the pbl. now for some pedagogy, first lets handle Sergey: you suggest: > Try to > # ps -fe | grep 10710 > # kill 10710 > did you try your idea? it won't work. so what's the point in making a posting? i saw a similar posting for a question regarding "truss" on DUX: someone says "try one of the CDs" in reply to someone who asks on which CD he can find truss. the latter mentions he searched them... then Jeff: > .... > > Outside the realm of vampires, you can't kill something that's > already dead, even a zombie process. That defunct process > still has a PID and a parent, but that's about it. well, defunct is EXACTLY a zombie. one is legacy unix term, the other is slang... > > If the parent PID of these defunct processes is 1 (the init process), > then you've hit an OS bug -- init should be cleaning these up. you wont encounter that.... > > > But if the parent isn't PID 1, then the only way to clean them up is > to kill the buggy parent, which isn't cleaning up its zombie children. what an interesting idea. mind you, on DUX 4.0x, yppasswdd also leaves a zombie. so kill it too... > > > Most likely, this app was ported from a System V base, where it > used signal() to set SIGCHLD to SIG_IGN, which causes the system to > clean up zombies automatically. > > Under Tru64 UNIX, formerly known as Digital UNIX, formerly know > as DEC OSF/1, formerly known as OSF/1, formerly known as > Mach 2.5, you have to use sigaction() with SA_FLAGS set to > SA_NOCLDWAIT for SIGCHLD to get the same automatic cleanup > behavior (or run in the UNIX 95 evironment using, > of course, the c89 compiler, or link with libsys5). Maybe you > can pass that on to your vendor. this is quite interesting, but is a bit aside the issue. --------------3AC3A96E7B3DDD4D3F35E3EA Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit both postings from Sergey and Jeff are missing the point.
the answer is simple:
when a parent forks a child, the child does an exit (for whatever reason, this may also be an abnormal exit) but the parent doesn't wait(2) on it, the kernel holds the accounting information for the child.
as soon as the parent do one of the wait variants, the kernel releases the PCB for the child and you wont see the defunct anymore.
a defunct is not annoying so much, it doesn't take system resources, except for a slot in the (limited) array of tasks.
if  you encounter a pbl with "no more processes", max_task is reached.
you can work around that by setting maxusers higher and wait for your vendor to fix the pbl.

now for some pedagogy, first lets handle Sergey:
you suggest:

Try to 
# ps -fe | grep 10710
# kill 10710


did you try your idea? it won't work. so what's the point in making a posting?
i saw a similar posting for a question regarding "truss" on DUX: someone says "try one of the CDs" in reply to someone who asks on which CD he can find truss. the latter mentions he searched them...

then Jeff:

....

Outside the realm of vampires, you can't kill something that's
already dead, even a zombie process.  That defunct process
still has a PID and a parent, but that's about it.

well, defunct is EXACTLY a zombie. one is legacy unix term, the other is slang...
 
If the parent PID of these defunct processes is 1 (the init process),
then you've hit an OS bug -- init should be cleaning these up.
you wont encounter that....
 

But if the parent isn't PID 1, then the only way to clean them up is
to kill the buggy parent, which isn't cleaning up its zombie children.

what an interesting idea. mind you, on DUX 4.0x, yppasswdd also leaves a zombie. so kill it too...
 

Most likely, this app was ported from a System V base, where it
used signal() to set SIGCHLD to SIG_IGN, which causes the system to
clean up zombies automatically.

Under Tru64 UNIX, formerly known as Digital UNIX, formerly know
as DEC OSF/1, formerly known as OSF/1, formerly known as
Mach 2.5, you have to use sigaction() with SA_FLAGS set to
SA_NOCLDWAIT for SIGCHLD to get the same automatic cleanup
behavior (or run in the UNIX 95 evironment using,
of course, the c89 compiler, or link with libsys5). Maybe you
can pass that on to your vendor.

this is quite interesting, but is a bit aside the issue. --------------3AC3A96E7B3DDD4D3F35E3EA--