<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Cameron Simpson wrote:
<blockquote cite="mid:20080626023446.GA10802@cskk.homeip.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator"
content="MS Exchange Server version 6.0.6619.12">
<title>Re: How to find and clear zombie processes w/o rebooting?</title>
<!-- Converted from text/plain format -->
<p><font size="2">On 25Jun2008 19:08, Daniel B. Thurman
<a class="moz-txt-link-rfc2396E" href="mailto:dant@cdkkt.com"><dant@cdkkt.com></a> wrote:</font>
<br>
<font size="2">> Looks like the parent is related to gdm-binary?</font>
<br>
<font size="2">> Strange about my comment previously - hit 'reset'
:D</font>
<br>
<font size="2">> Wonder what is going on with Xsession and why it
died.</font>
<br>
<font size="2">></font>
<br>
<font size="2">> This is what I found:</font>
<br>
<font size="2">> ===================</font>
<br>
<font size="2">> root 3704 0.0 0.1 18416 2096 ?
Ss Jun24 0:00 /usr/sbin/gdm-binary -nodaemon</font>
<br>
<font size="2">> root 3797 0.0 0.0 17896 2064 ?
S Jun24 0:00 \_ /usr/sbin/gdm-binary -nodaemon</font>
<br>
<font size="2">> root 3801 2.4 2.2 63512 47528 tty7
Ss+ Jun24 40:15 \_ /usr/bin/X :0 -br -audit 0 -auth
/var/gdm/:0.Xauth -nolisten tcp vt7</font></p>
<p><font size="2">> dant 3854 0.0 0.1 33768 4104 ?
Ssl Jun24 0:01 \_ /usr/bin/gnome-session</font>
<br>
<font size="2">> dant 3902 0.0 0.0 0 0 ?
Z Jun24 0:00 \_ [Xsession] <defunct></font>
<br>
<font size="2">> dant 3956 0.0 0.0 6328 252 ?
Ss Jun24 0:00 \_ /usr/bin/ssh-agent /usr/bin/dbus-launch
--exit-with-session /etc/X11/xinit/Xclients</font></p>
<p><font size="2">[...]</font>
</p>
<p><font size="2">Ok, this mean gnome-session forked a run of
Xsession and didn't wait for</font>
<br>
<font size="2">it. Xsession has exited, but whatever gnome-session
really waits for</font>
<br>
<font size="2">(typically the window manager) has not yet exited.</font>
</p>
<p><font size="2">This is really common in xsession/xinitrc type
shell scripts. You see</font>
<br>
<font size="2">people write their sessions like this:</font>
</p>
<p><font size="2"> xterm &</font>
<br>
<font size="2"> xclock &</font>
<br>
<font size="2"> window-manager</font>
</p>
<p><font size="2">So, that is a shell script. It kicks off a
terminal, a clock and a</font>
<br>
<font size="2">window manager. It waits for that last. When the
window manager exits</font>
<br>
<font size="2">(usually from the quit/logout menu item), the session
ends, and gdm/xdm</font>
<br>
<font size="2">kills the X server and starts a new server for a new
login prompt.</font>
</p>
<p><font size="2">Now.. if the terminal or clock exit, they will be
zombies. The script is</font>
<br>
<font size="2">may be waiting only for the window manager, expecially
if the last line</font>
<br>
<font size="2">goes:</font>
</p>
<p><font size="2"> exec window-manager</font>
</p>
<p><font size="2">because the window manager will _replace_ the
script, and thus be the</font>
<br>
<font size="2">parent of the terminal and clock, but it will not be
waiting for them.</font>
</p>
<p><font size="2">It is normally desirable to run "tools" (the
terminal, the clock,</font>
<br>
<font size="2">nautilus etc) as children of a throw away subshell,
thus:</font>
</p>
<p><font size="2"> ( xterm &</font>
<br>
<font size="2"> xclock &</font>
<br>
<font size="2"> )</font>
<br>
<font size="2"> exec window manager</font>
</p>
<p><font size="2">That way the tools are forked off from a subshell,
the subshell exits,</font>
<br>
<font size="2">and the children get inherited by init (_not_ the top
shell!) whose</font>
<br>
<font size="2">purpose in life is to catch such children and reap
them, to prevent them</font>
<br>
<font size="2">becoming zombies.</font>
</p>
<p><font size="2">So:</font>
<br>
<font size="2"> - it is really a problem in gnome-session</font>
<br>
<font size="2"> - it isn't important, and is not related to your
resource problems</font>
</p>
</blockquote>
<br>
Well! Thanks for the explanation!<br>
I guess I will just reboot - problem solved!<br>
<br>
Thanks alot!<br>
Dan<br>
<br>
</body>
</html>