Check if a program has been killed
How do I check if a program has been killed in PERL? I suspect I can do something like ps ax | grep 'program-name', loop through, use regular expression.
But I think this is like a hackish approach.
I am using something like system ("INT", procId) (in a fork), basically to send a signal to kill a process. The process will take about 2 minutes to kill. How will I know when the process is killed? What is the correct method? I understand a program normally returns an 'exit value' when it exits correctly. Can I possibly make use of this property?
Thanks
aaron
|