From: Thiago Arrais Date: 2006-09-01T02:07:10+09:00 Subject: Spawning daemon processes I am trying to start and stop a daemon process from inside my Ruby program. At first I tried using fork to do the job, as in server_pid = fork do system 'runserver' end Then I could use the returned PID to send the process a signal by using Process.kill. But, as far as i know, fork unfortunately doesn't work on Windows. I read somewhere I should be using Thread.new if I want the code to be platform independent, like this: thread = Thread.new do system 'runserver' end The question is: how do I kill the subprocess when using threads? I tried thread.kill and thread.stop, but they won't do the trick. When using threads, what I get are a lot of orphan processes after the initial Ruby program finishes. Is there any idiomatic way of doing that in Ruby that is platform independent? Cheers, Thiago Arrais -- Mergulhando no Caos - http://thiagoarrais.blogspot.com Pensamentos, id�ias e devaneios sobre desenvolvimento de software e tecnologia em geral