How to find and clear zombie processes w/o rebooting?

Daniel B. Thurman dant at cdkkt.com
Thu Jun 26 03:49:27 UTC 2008


Cameron Simpson wrote:
>
> On 25Jun2008 19:08, Daniel B. Thurman <dant at cdkkt.com> wrote:
> > Looks like the parent is related to gdm-binary?
> > Strange about my comment previously - hit 'reset' :D
> > Wonder what is going on with Xsession and why it died.
> >
> > This is what I found:
> > ===================
> > root      3704  0.0  0.1  18416  2096 ?        Ss   Jun24   0:00 
> /usr/sbin/gdm-binary -nodaemon
> > root      3797  0.0  0.0  17896  2064 ?        S    Jun24   0:00  \_ 
> /usr/sbin/gdm-binary -nodaemon
> > 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
>
> > dant      3854  0.0  0.1  33768  4104 ?        Ssl  Jun24   
> 0:01      \_ /usr/bin/gnome-session
> > dant      3902  0.0  0.0      0     0 ?        Z    Jun24   
> 0:00          \_ [Xsession] <defunct>
> > 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
>
> [...]
>
> Ok, this mean gnome-session forked a run of Xsession and didn't wait for
> it. Xsession has exited, but whatever gnome-session really waits for
> (typically the window manager) has not yet exited.
>
> This is really common in xsession/xinitrc type shell scripts. You see
> people write their sessions like this:
>
>   xterm &
>   xclock &
>   window-manager
>
> So, that is a shell script. It kicks off a terminal, a clock and a
> window manager. It waits for that last. When the window manager exits
> (usually from the quit/logout menu item), the session ends, and gdm/xdm
> kills the X server and starts a new server for a new login prompt.
>
> Now.. if the terminal or clock exit, they will be zombies. The script is
> may be waiting only for the window manager, expecially if the last line
> goes:
>
>   exec window-manager
>
> because the window manager will _replace_ the script, and thus be the
> parent of the terminal and clock, but it will not be waiting for them.
>
> It is normally desirable to run "tools" (the terminal, the clock,
> nautilus etc) as children of a throw away subshell, thus:
>
>   ( xterm &
>     xclock &
>   )
>   exec window manager
>
> That way the tools are forked off from a subshell, the subshell exits,
> and the children get inherited by init (_not_ the top shell!) whose
> purpose in life is to catch such children and reap them, to prevent them
> becoming zombies.
>
> So:
>   - it is really a problem in gnome-session
>   - it isn't important, and is not related to your resource problems
>

Well! Thanks for the explanation!
I guess I will just reboot - problem solved!

Thanks alot!
Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080625/4d6eccdb/attachment-0001.htm>


More information about the fedora-list mailing list