Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

process.daemonize behavior #55

Open
ghost opened this issue Mar 28, 2018 · 1 comment
Open

process.daemonize behavior #55

ghost opened this issue Mar 28, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 28, 2018

If I have the option

process.daemonize = true

configured my start command cannot perform any sort of logging or output to stdout:

#!/usr/bin/env ruby
require 'logger'
class Job
  attr_accessor :logger
  def initialize
    @logger = Logger.new('job.log')
  end
  def log(string)
    @logger.info(string)
    # File.open('job.log', 'w') do |f|
    #   f.write(string)
    # end
    # puts string
  end

  def run
    a = []
    while true; a << 'x' * 1024; end
    log("size: #{a.size / 1024}M")
  end
end

j = Job.new
j.run

I also tried these options:

process.stdout = 'stdout.log'
process.stderr = 'stderr.log'

but did not see any notable change in behavior.

@ghost
Copy link
Author

ghost commented Mar 29, 2018

To clarify, after more testing I realized I never see any output because my start_command never starts when I use process.daemonize = true.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants