From: "Iñaki Baz Castillo" Date: 2009-06-14T03:10:57+09:00 Subject: Re: How to daemonize a Ruby program 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: ---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 ¿?¿?¿ Do I miss something? The above comes in the documentaion of Daemons: http://daemons.rubyforge.org/ -- Iñaki Baz Castillo