From: Jayce Meade Date: 2009-02-19T12:19:52+09:00 Subject: Re: Starting a process from inside Ruby Fork would work from what I've read, I believe it starts the other process and continues execution of the current ruby script, the external process runs until it is (from what I understand) terminated by the parent script, normal exit, and the like. This should help, it covers the basic process management... features? provided by ruby, including threads, system(), exec(), fork(), etc.. http://andrejserafim.wordpress.com/2007/12/16/multiple-threads-and-processes-in-ruby/ On this subject, when I use fork, I get an error saying it hasn't been implemented, how would I fix this? - jayce -------------------------------------------------- From: "Michael Malone" Sent: Wednesday, February 18, 2009 5:18 PM To: "ruby-talk ML" Subject: Re: Starting a process from inside Ruby > Petr Janda wrote: >> Hi all, >> Im facing a small dilema trying to start a process called "ezstream" >> from inside a ruby on rails application and retreive its PID. >> >> Ezstream is used for streaming audio into an icecast server so normally >> this process runs in background for a long time. I tried it with >> IO.popen but then the application hangs indefinitely. What I need to do >> is start the app, get its PID(to store it in a databasse), and move it >> to the background so the rails application doesnt hang. >> >> Any ideas? >> Petr >> > I don't know if this works inside rails but the Kernel#fork method is a > good idea! > > pid = fork() do > #Ezstream stuff > end > #store pid in db > ... > wait(pid) > > ======================================================================= > This email, including any attachments, is only for the intended > addressee. It is subject to copyright, is confidential and may be > the subject of legal or other privilege, none of which is waived or > lost by reason of this transmission. > If the receiver is not the intended addressee, please accept our > apologies, notify us by return, delete all copies and perform no > other act on the email. > Unfortunately, we cannot warrant that the email has not been > altered or corrupted during transmission. > ======================================================================= > > >