def run_daemonized
Signal.trap('HUP') {}
pid = fork do
begin
require 'god'
if @options[:pid]
God.pid = @options[:pid]
end
unless @options[:syslog]
Logger.syslog = false
end
default_run
unless God::EventHandler.loaded?
puts
puts "***********************************************************************"
puts "*"
puts "* Event conditions are not available for your installation of god."
puts "* You may still use and write custom conditions using the poll system"
puts "*"
puts "***********************************************************************"
puts
end
rescue => e
puts e.message
puts e.backtrace.join("\n")
abort "There was a fatal system error while starting god (see above)"
end
end
if @options[:pid]
File.open(@options[:pid], 'w') { |f| f.write pid }
end
::Process.detach pid
exit
end