From: Nobuyoshi Nakada Date: 2009-02-20T13:09:13+09:00 Subject: Re: a little daemon daemonizes, but hangs the logout Hi, At Thu, 19 Feb 2009 23:25:20 +0900, Brian Candler wrote in [ruby-talk:328745]: > And there is this one from rackup (part of the rack package) > > if daemonize > if RUBY_VERSION < "1.9" Assuming it's possible to check a feature by version number is an evil habitat. You can just do it by unless defined?(Process.daemon) or, define your own Process.daemon. module Process unless defined?(daemon) def self.daemon(nochdir=nil, noclose=nil) exit! if fork Process.setsid unless nochdir Dir.chdir "/" end unless noclose STDIN.reopen "/dev/null" STDOUT.reopen "/dev/null", "w" STDERR.reopen STDOUT end end end end -- Nobu Nakada