Re: Runaway process detection.
Dan Serban wrote:
On Sun, 27 Feb 2011 16:23:37 -0800
Dan Serban <email@example.com> wrote:
Because of a bug in gtk, iceweasel and others (google helped me
find the bug reports) nautilus for some users pegs at 100% cpu use
because .xsession-errors fills up at incredible rates, which in turn
basically hangs the machine (nautilus ends up using over 40 gigs of
I can't kill the parent as it'll bring everyone's desktop down and...
that's even worse.
To answer my own question, I came up with the following:
ps h -C nautilus -o pid,pmem,user|while read -r progpid pcntmem puser; do
if (( $(bc <<< "$pcntmem > 10") )); then
kill -15 $progpid
echo '' > /home/$puser/.xession-errors
The above is run every minute via cron. Thought I'd share with the
community in case anyone else ran into the same type of problem.
To explain the above, ps simply returns any processes of which the command
contains nautlius with pid, percentage memory, user. If the percentage
memory is above 10% (bc is used to deal with floating point numbers) then
kill the process.
I've done a lot of googling and couldn't find anything that would handle
child processes so I had to piece this together.
Could you post when you find it worked?