Iñaki Baz Castillo
6/13/2009 6:43:00 PM
El S=C3=A1bado, 13 de Junio de 2009, I=C3=B1aki Baz Castillo escribi=C3=B3:
> El S=C3=A1bado, 13 de Junio de 2009, I=C3=B1aki Baz Castillo escribi=C3=
=B3:
> > El S=C3=A1bado, 13 de Junio de 2009, I=C3=B1aki Baz Castillo escribi=C3=
=B3:
> > > 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 keywor=
ds
> > "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:
>
> ---daemon1.rb----------------------
> #!/usr/bin/env ruby
>
> require 'daemons'
>
> Daemons.daemonize
>
> loop do
> sleep 2
> end
> ------------------------------------
>
> I run it (ruby daemon1.rb) and after it I check if there is any ruby
> process running:
> ps -ef | grep ruby
>
> but it's not running =C2=BF?=C2=BF?=C2=BF
Ups, forget it please, it works :)
=2D-=20
I=C3=B1aki Baz Castillo <ibc@aliax.net>