From: Michael Malone Date: 2009-02-19T10:18:18+09:00 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. =======================================================================