From: Giuseppe Bilotta Date: Thu, 20 Jul 2006 17:47:13 +0000 (+0000) Subject: Redirect standard streams if backgrounding was requested even if the fork failed X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=485776ce70e37ecfa56740ae02ce11586b8686d9;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Redirect standard streams if backgrounding was requested even if the fork failed --- diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 88a85483..8233f3c5 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -190,16 +190,12 @@ class IrcBot exit if fork rescue NotImplementedError puts "Could not background, fork not supported" - $daemonize = false rescue => e puts "Could not background. #{e.inspect}" - $daemonize = false end - end - - if $daemonize Dir.chdir botclass # File.umask 0000 # Ensure sensible umask. Adjust as needed. + puts "Redirecting standard input/output/error" begin STDIN.reopen "/dev/null" rescue Errno::ENOENT