Originally posted by: SystemAdmin
Thanks all for your replies. The problem is that the runaway script is like a virus which is self-duplicating. Fortunately the user has a ulimit for the number of threads (several thousands) he can create therefore the number of processes stop increasing after the ulimit is reached. However any time you kill a process, a new process is created by the remaining process. Unless you can kill all processes at the same time you can not kill all of them.
I found a way to kill them by first sending SIGSTOP (17) to all of them, then killing them one by one.
ps -ef | grep user_name >list; while read a b c; do (echo $b;kill -17 $b) done <list >/dev/null 2>&1
ps -ef | grep user_name >list; while read a b c; do (echo $b;kill -9 $b) done <list >/dev/null 2>&1
#AIX-Forum