From: Martin aus Chemnitz Date: 2005-05-24T14:40:17+09:00 Subject: Killing a Process started with Kernel.system Hi! I know, this question was asked a dozen times, but I can't believe that Ruby does not offer a suitable solution. I therefore write this posting more in the spirit of an urgent feature request. Under Windows, I want to start an external program and kill it on exitting my Ruby script. begin $t = Thread.new { system("everlasting") } ... ensure $t.kill end does not stop the everlasting program, it stops $t, not its child processes. Such a command is urgently needed! Yukihiro Matsumoto writes in <1052988371.738185.28868.nullmailer@picachu.netlab.jp>: > If you want to kill child processes when the thread is down, > > th = Thread.new{ > Thread.current[:children] = [] > begin > ... add child processes to Thread.current[:children] > ensure > Process.kill("TERM", *Thread.current[:children]) > end > } but I think I can't get the PID of a system call either. I would be glad if such a feature could be implemented. (Or, of course, if anyone can tell me suitable solution.) Martin