View Single Post

  #12  
Old 06-30-2008, 04:45 PM
Default Re: How to get an "alert" when a process dies

On Jun 30, 12:36*pm, Ralf Fassel wrote:
> * nicc777
> | Is there a way to trigger an event (like running a script) when a
> | process dies? Perhaps even a script to restart a process if it detects
> | that it's dead?
>
> * #!/bin/sh
> * while true ; do
> * * *run_your_process
> * * *status=$?
> * * *case $status in
> * * * *0) : probably ok? ; break ;;
> * * * **) echo "process has exited with status $status, re-run"
> * * *esac
> * donex
>
> ?
>
> R'


Cool - not what I expected, but it does work perfectly :-)

I think I was making the problem to complicated.

Thanks a mil
Reply With Quote