From: nobuyoshi nakada Date: 2005-05-24T15:37:59+09:00 Subject: Re: Killing a Process started with Kernel.system Hi, At Tue, 24 May 2005 14:40:17 +0900, Martin aus Chemnitz wrote in [ruby-talk:143491]: > 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. Fundamentally, since Kernel.system doesn't finish until the child process exits, so PID can not be available. > I would be glad if such a feature could be implemented. (Or, of course, > if anyone can tell me suitable solution.) In 1.9, Kernel.spawn (or Process.spawn) does it. -- Nobu Nakada