It doesn't look like vanilla Daemons
can do what you want, but it's fixable. Try something like this:
require 'rubygems'
require 'daemons'
module Daemons
class Application
def logfile; '/log/f1'; end
def output_logfile; '/log/f2'; end
end
end
Daemons.run '/tmp/test.rb',
:dir => '/tmp/pids',
:dir_mode => :normal,
:ontop => false,
:log_output => true
You probably want the logic of *logfile to act more like the originals; just scan the daemons source for def.logfile. I would also have rather patched a subclass of Application
but it is instantiated by name elsewhere in module Daemons so that makes things tricky.