From: Vect Vect on
Rein Henrichs wrote:
> On 2010-06-07 14:47:49 -0700, Vect Vect said:
>
>> I want to find out how to get a event machine app running in the
>> background.
>>
>> In example scripts I have seen when the script are executed it runs in
>> the console but when the window/ssh session is closed the app stops.
>>
>> What needs to be done to have the scripts running as a process in the
>> background
>
> This is not strictly a Ruby question. It's a *nix question. The answers
> already provided are sufficient, however:
>
> A simple `ruby myscript.rb &` would also suffice, although process
> control would then be more difficult.
>
> The more complete and general way to handle such processes in the *nix
> world is the use of an init-like, like initd, runit or OS X's launchd.

thanks guys.

I think screen is looking like a suitable solution
--
Posted via http://www.ruby-forum.com/.

From: Kirk Haines on
On Mon, Jun 7, 2010 at 5:01 PM, Vect Vect <vectorno(a)googlemail.com> wrote:
> What are some projects that do this and do they work with eventmachine

If you are writing the software, it's simple. You should do a little
background research, IMHO, so that you understand what daemonizing is.

http://www.google.com/search?q=how+to+daemonize+a+process

Once you understand that, you can pretty easily write a little Ruby
code to do a passable job yourself. There's not much to it.

Or, you can use someone else's project to do it:

gem search -r daemon

Take a look at some of those. Here's one that has been around for a while:

http://daemons.rubyforge.org/

Good luck!


Kirk Haines