So, how could I get the programm running in background?
This is, I must be able tu run the program in a terminal:
./my_server.rb
and leave the same terminal free to use it while the daemon is running.
El Sábado, 13 de Junio de 2009, Iñaki Baz Castillo escribió:
El Sábado, 13 de Junio de 2009, Iñaki Baz Castillo escribió:
> I need to daemonize it to get it working in background so I can manage
> the service using a Debian init script, but I have no idea of how to do
> it.
I had no luck on my first Google search, but I've tryed now eith keywords
"daemonize ruby" and got two possbile solutions :
1) Using "daemons" gem
2) Using "fokk" and Process.detach
------------------------------------
I run it (ruby daemon1.rb) and after it I check if there is any ruby process
running:
ps -ef | grep ruby
El Sábado, 13 de Junio de 2009, Iñaki Baz Castillo escribió:
El Sábado, 13 de Junio de 2009, Iñaki Baz Castillo escribió:
> El Sábado, 13 de Junio de 2009, Iñaki Baz Castillo escribió:
> > I need to daemonize it to get it working in background so I can manage
> > the service using a Debian init script, but I have no idea of how to do
> > it.
>
> I had no luck on my first Google search, but I've tryed now eith keywords
> "daemonize ruby" and got two possbile solutions :
>
> 1) Using "daemons" gem
> 2) Using "fokk" and Process.detach
I wonder why the following code doesn't work at all: