killing cascade processes

Hi everybody!!

I've got a problem. I have a loop like this:

while true; do 
  some_work
  sleep 10m
done

It's possible to kill the main loop process and kill all childs from it? I want to kill main process and kill the sleep also. I tried kill -9 <loop_pid> with no result

Thanks in advance!!

You will have to kill the ksh instance from where the while loop was run.

Thank you blowtorch.

The problem is that the loop is executed through an apache web server with haserl interpreter (a way to build dinamic web with shell script).

When I kill the process with -9 signal, haserl process becomes in zombie state:

 PID TTY      STAT   TIME COMMAND
7821 ?        Z      0:00 [haserl] <defunct>

How can I force the exiting of this zombie process??

how about patching the code

echo $$ > /var/run/process.pid
while true; do 
  some_work
  [ ! -f /var/run/process.pid ] && exit 1
  sleep 10m
done

Not works, so the process can be killed althought it's slept