title: ruby - can't write to logs in daemons
body: <p>Normally I can write logs with <code>Logger</code>:</p>
  
  <pre><code>//abc.rb
  require 'logger'
  logger = Logger.new('foo.log')
  
  $./abc.rb
  </code></pre>
  
  <p>But in a <code>Daemons</code> I got a permission error:</p>
  
  <pre><code>//xyz.rb
  require 'logger'
  require 'daemons'
  
  Daemons.run_proc('xyz') do
    logger = Logger.new('foo.log')
  end
  
  $./xyz.rb
  /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:599:in `initialize': Permission denied - foo.log (Errno::EACCES)
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:599:in `open'
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:599:in `create_logfile'
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:594:in `open_logfile'
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:549:in `initialize'
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:314:in `new'
  from /home/raincole/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/logger.rb:314:in `initialize'
  </code></pre>
  
  <p>I ran <code>abc.rb</code> and <code>xyz.rb</code> in the same directory and with the same identity. Why can't one log as the other can?</p>