[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hanging kdeinit processes.



> I'm currently running Debian Unstable, with KDE 3.0.4, using the packages
> from
> kde.org.  For some reason, when I log out, I end up with a kdeinit process
> still running, causing 100% CPU utilization.  It's easy enough to kill -9
> that process, but I'm wondering what's causing it to hang and eat my CPU,
> and how to fix it.

This process is kdesktop.
We are running a terminal application server here, with about 15 terminals 
connected running KDE, and after users logout kdesktops often hang.

As a workaround for now, I have the following script constantly running as 
root. Ugly hack, but works.


#!/bin/bash

getpids()
{
  ps ax | grep kdesktop | awk '$3=="R" {print($1)}'
}

gethanged()
{
  (i=0; while [ $i -lt 10 ]; do getpids; sleep 1; i=$[$i+1]; done) |
    awk 'a[$1]=="" {a[$1]=0}
         {a[$1]++}
         END {for (i in a) if (a[i]==10) print(i)}'
}

while true; do
  if [ x"`getpids`" = x ]; then sleep 60; continue; fi
  l=`gethanged`
  if [ x"$l" != x ]; then
    echo `(date; echo ":  KILLING:  $l") | tr '\n' ' '`
    kill -9 $l
  fi
done



Reply to: