title: Why Ruby Daemons.run_proc block was skipped entirely on ubuntu 12.04
body: <p>We are trying to to start a daemon with <code>gem daemons</code> on <code>ubuntu 12.04</code> and <code>rails 3.2.12</code> environment for a ruote worker. Here is the daemon.rb (<code>gem version 1.1.9</code>):</p>
  
  <pre><code>#!/usr/bin/env ruby
  require 'daemons'
  require 'logger'
    root = Dir.pwd
    Dir.chdir(root)
    file = Dir.pwd + '/ruote_worker.rb' 
    options = {
      :dir_mode   =&gt; :normal,
      :dir        =&gt; File.join(root, 'amine.log'),
      :log_output =&gt; true,
      :backtrace  =&gt; true,
      :multiple   =&gt; false
    }
  
    logger = Logger.new('foo.log')
    logger.info('----before daemon----') 
  
    Daemons.run_proc('ruote_worker', options) do
      # Server loop:
      loop {
        puts '111111111111111'
        logger.info('aaaaaaaaaaaaaaa')
      }
    end
  </code></pre>
  
  <p>Here is the foo.log:</p>
  
  <pre><code># Logfile created on 2013-11-10 12:56:12 -0600 by logger.rb/36483
  I, [2013-11-10T12:56:12.594196 #26557]  INFO -- : ----before daemon----
  </code></pre>
  
  <p>Here is the ruote_worker.rb (for testing purpose):</p>
  
  <pre><code>#!/usr/bin/env ruby
  
  require 'logger'
  logger = Logger.new('amine.log')
  
  loop do
      logger.info('---amine---')
      puts '*****************************************************  Amine ****************************'
      sleep 5
  end
  </code></pre>
  
  <p>As the log shows, the <code>Daemons.run_proc()</code> block was entirely skipped and not executed at all.  We tried <code>Daemons.run_proc()</code> without 'ruote_worker' and <code>Daemons.call()</code> and none of the code inside the block was executed. Somehow the whole block was skipped and never gets executed. Can someone shed light on how to make the daemon work? We have limited experience with ruby daemons gem (details welcome). Thanks. </p>