From: Vect Vect on 7 Jun 2010 17:47 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 -- Posted via http://www.ruby-forum.com/.
From: Bill Kelly on 7 Jun 2010 18:25 Vect Vect wrote: > 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 A couple possibilities: /usr/bin/nohup /usr/bin/screen nohup will allow the output to be logged to a file, and keep the process running when you disconnect. screen will allow the actual 'console' to be preserved, so that you can reconnect to it later. (The manpage for screen is lengthy and may appear a little daunting at first, but there are only a few concepts to learn to begin using screen. If you're doing much work over ssh, it's an extremely useful command.) Hope this helps, Bill
From: Joel VanderWerf on 7 Jun 2010 18:43 Bill Kelly wrote: > Vect Vect wrote: >> 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 > > A couple possibilities: > > /usr/bin/nohup > > /usr/bin/screen > > > nohup will allow the output to be logged to a file, and keep the > process running when you disconnect. > > screen will allow the actual 'console' to be preserved, so that > you can reconnect to it later. > > (The manpage for screen is lengthy and may appear a little daunting > at first, but there are only a few concepts to learn to begin using > screen. If you're doing much work over ssh, it's an extremely > useful command.) Those are ideal choices, particularly if you don't want to touch the source code. If you want to write a program that just runs in the background with no need for screen or nohup, look into the various daemonize methods people have written in ruby.
From: Vect Vect on 7 Jun 2010 19:01 What are some projects that do this and do they work with eventmachine Joel VanderWerf wrote: > Bill Kelly wrote: >> A couple possibilities: >> you can reconnect to it later. >> >> (The manpage for screen is lengthy and may appear a little daunting >> at first, but there are only a few concepts to learn to begin using >> screen. If you're doing much work over ssh, it's an extremely >> useful command.) > > Those are ideal choices, particularly if you don't want to touch the > source code. If you want to write a program that just runs in the > background with no need for screen or nohup, look into the various > daemonize methods people have written in ruby. -- Posted via http://www.ruby-forum.com/.
From: Rein Henrichs on 7 Jun 2010 19:07
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. -- Rein Henrichs http://puppetlabs.com http://reinh.com |