From: David Masover Date: 2009-02-16T17:21:35+09:00 Subject: Re: Controlling a forked process Michael Satterwhite wrote: > If I start a process, is there some way that I can maintain control of > it. More specifically, can I start a process and then at some point > based on a user action kill that process. I see hints of that in the > documentation, but I don't see anything that specifically addresses this > case. > Yes. The parent process should have the process ID of the child. With that you can do things like: if (pid = fork) sleep 1 Process.kill('TERM', pid) else loop do puts 'KILL ME' end end Or you could kill with 'KILL', if you really need it dead RIGHT NOW -- but you might want to read 'man kill' first.