Matthew Emmett <[EMAIL PROTECTED]> writes:
ME> Dwight Johnson <[EMAIL PROTECTED]> writes:
ME> $ ps -o pid,ppid,cmd | grep "dns helper"
ME> 
ME> tells me the pid and ppid of any "dns helper" netscape processes (and
ME> grep, but I'll filter that out).  Next, I take all but the largest pid
ME> and kill it.  This way, if the user's netscape died and they start a
ME> new one right away, my script will only kill those dead-chicken
ME> netscape's.  Does this sound like it will work reliably?

Note that pid's aren't necessarily monotonically increasing; after
they get up in the 30,000's somewhere, they'll start wrapping around
to otherwise unused pid values.  I can't think of a good way to do
what you're trying to do, though.

One thought: what about, instead of starting netscape directly, run a
wrapper script that first kill -9's any running netscape, and then
starts a new one?  It sounds like this should do mostly what you want
for a public terminal with exactly one netscape running at any given
time.  You could even wrap it in a shell loop to clean up if netscape
happens to die.

-- 
David Maze             [EMAIL PROTECTED]          http://www.mit.edu/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
        -- Abra Mitchell

Reply via email to