I'm trying to get a daemon to work on debian using daemons gem. I
via gems and I'm running version 1.0.3.
I used daemon_generator from
I created a daemon called test and ran it on OSX with no problem,
both work fine.
I moved it to a debian system, modifed test.rb to use the production
environment, and I can't get it to work. I've tried a bunch of things.
doesn't seem to start reliably
On the debian system
sometimes works. I see the daemon running, I see the monitor daemon
messages are going into the production log file.
If I try to stop it with
the test daemon stops but the monitor does *not* stop. Then I get a log
the test daemon with
# Logfile created on Thu Dec 07 15:33:33 -0800 2006 by
failed to allocate memory
stack level too deep
uninitialized constant Rails
no such file to load -- rails.rb
No such file or directory - [snip]/log/test.rb.pid
no such file to load -- openssl
no such file to load -- http-access2
no such file to load -- xmlscan/scanner
no such file to load -- xml/parser
no such file to load -- tmail/scanner_c.so
no such file to load -- tmail/base64.so
Here is lib/daemons/test.rb:
#You might want to change this
ENV["RAILS_ENV"] ||= "production"
require File.dirname(__FILE__) + "/../../config/environment"
$running = true;
$running = false
# Replace this with your code
ActiveRecord::Base.logger << "This daemon is still running at
and here is the ctl file:
options = YAML.load(
File.dirname(__FILE__) + "/../../config/daemons.yml"
options[:dir_mode] = options[:dir_mode].to_sym
Daemons.run File.dirname(__FILE__) + '/test.rb', options
# this is a comment