zombie defunct processes
Posted in 1999
Topics: Platform-Specific Issues
hi all: I am using solaris 2.6 with informix 7.22. I am not really sure this is caused by informix, but I have about 50 defunct processes running on the system, all zombies, anyone seen that before? by the way, what's a easy one liner to kill all processes with "defunct" as name in unix? thanks a lot. yan
Hi Yan, your problem is the DISCONNECT statement. There is a solution on IIUG. After DISCONNECT or sqlexit you have to wait until the child-process is killed. (the wait()-fkt from sys/wait.h helps) Bye Dirk Niemeier Yan Zhu schrieb: > hi all: > I am using solaris 2.6 with informix 7.22. > I am not really sure this is caused by informix, but I have about 50 > defunct processes running on the system, all zombies, anyone seen that > before? > by the way, what's a easy one liner to kill all processes with > "defunct" as name in unix? > thanks a lot. > yan
On Thu, 21 Jan 1999, Yan Zhu wrote: > by the way, what's a easy one liner to kill all processes with > "defunct" as name in unix? Hi, You can't kill defunct processes. The only way to get rid of them is to reboot the server. However, they don't consume resources, so it's OK to leave them (true for SCO 5.0.x, I imagine same applies to other flavours). Only problem might be if the number of defunct processes increases to a level that fills up the process table so new processes can't be spawned, but this would indicate a serious problem elsewhere which would require immediate investigation. Cheers, Richard.
Yan Zhu wrote:
>
> hi all:
> I am using solaris 2.6 with informix 7.22.
> I am not really sure this is caused by informix, but I have about 50
> defunct processes running on the system, all zombies, anyone seen that
> before?
> by the way, what's a easy one liner to kill all processes with
> "defunct" as name in unix?
> thanks a lot.
Defunct processes are already dead so you cannot kill them. Look at
their parent processes and kill them. Defuncts are caused by a child
process dieing and its parent not executing a wait() system call to
retrieve its exit status. The child's process table entry must hang
around waiting for the wait system call so the exit status is not lost.
If the parent is killed, on SysV based UNIXes, the init process will
inherit the defunct children and perform the wait() to get rid of them.
Is this IDS 7.22 or SE 7.22? If SE then the defuncts may be the sqlexec
processes that database clients start up. If IDS there is not such
process so the defuncts are either dead oninit children, which is
doubtful since oninit does monitor its children, or children of your
application programs, through fork/exec or system, which are not
wait()ed for. If you have processes that start children the parent
should have a SIGCHLD (or SIGCLD) handler that calls wait3() in a loop,
with the WNOHANG option passed, until wait3() return zero (no children
and would have blocked) then return. The loop is because if multiple
children die or receive signals that affect their run status (is
SIGSTOP, SIGCONT, etc) before the SIGCHLD handler returns the SIGCHLD
handler will be called only once for all those children.
Art S. Kagel
Of course if it's a zombie and the ppid=1 don't login as root to kill it....
;-)
PS.
Just in case.....
Art S. Kagel wrote:
> Yan Zhu wrote:
> >
> > hi all:
> > I am using solaris 2.6 with informix 7.22.
> > I am not really sure this is caused by informix, but I have about 50
> > defunct processes running on the system, all zombies, anyone seen that
> > before?
> > by the way, what's a easy one liner to kill all processes with
> > "defunct" as name in unix?
> > thanks a lot.
>
> Defunct processes are already dead so you cannot kill them. Look at
> their parent processes and kill them. Defuncts are caused by a child
> process dieing and its parent not executing a wait() system call to
> retrieve its exit status. The child's process table entry must hang
> around waiting for the wait system call so the exit status is not lost.
> If the parent is killed, on SysV based UNIXes, the init process will
> inherit the defunct children and perform the wait() to get rid of them.
>
> Is this IDS 7.22 or SE 7.22? If SE then the defuncts may be the sqlexec
> processes that database clients start up. If IDS there is not such
> process so the defuncts are either dead oninit children, which is
> doubtful since oninit does monitor its children, or children of your
> application programs, through fork/exec or system, which are not
> wait()ed for. If you have processes that start children the parent
> should have a SIGCHLD (or SIGCLD) handler that calls wait3() in a loop,
> with the WNOHANG option passed, until wait3() return zero (no children
> and would have blocked) then return. The loop is because if multiple
> children die or receive signals that affect their run status (is
> SIGSTOP, SIGCONT, etc) before the SIGCHLD handler returns the SIGCHLD
> handler will be called only once for all those children.
>
> Art S. Kagel