OK there seemed to be some interest, so here it is in its
simplest form. This one kills a single zombie netscape and all
its children.
I have some difficulty with the fact that there are orther
species of wild netscapes which this routine does not hunt, but I
am still testing netshkape2.
>-----------------------------------Begin
#!/bin/sh
# routine to kill a zombie netscape without user intervention
# Save this as a text file and right click the icon, editing
# properties to make it executable, then drag it to the autostart
folder
# or else save it as a file and put ~/(filename) in rc.local
#----------------------------------------------------------
#
# The method is to use ps and grep to pipe two lines to gawk
which
# prints an output used by set to make the variable netshk equal
# to the process id of ld-linux-so.2 (which runs netscape as a
child)
# if the ps output lists netscape as a zombie process
#
# netshkape2 uses a similar technique except it does
# gawk '/ld-linux.so.2/{print $1}' ` at the end of the line
# for setting netshk to the pid thus obtaining the pid of a
# netscape process whether running or not (this is done after
the
# standard "zombie" test).
#
# Once the pid of a running netscape process is discovered, then
top
# is started, with output to /tmp/.netshk and killed by killall
after
# after 3 seconds
#
# then gawk is run using this as an input and matching on the pid
of
# netscape. Currently it kills when it sees 98% or higher CPU
usage by
# this routine, which usually means it is thrashing the swap file
and
# gobbling memory and being a nuisance. I am not ready to
release this
# second version and I hope I shall never have to--Netscape beta
6
# in a few more days.
while [ 1 ]
do
set netshk = 0
set netshk = `ps ax | grep ld-linux.so | gawk '/Z/{print $1}' `
if [ ${netshk} > 1 ]
then
kill -9 ${netshk}
fi
sleep 600
done
#
#---------------------------------------------
>-----------------------------------------end on line before this
Well, there it is, and the plans for the bigger one if you care
to test it.
No warranty, you break it, you keep all the pieces.
Civileme
--
Remember that if it is done on networks, it may occur on
your host which is a network unto itself.