Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Don't daemonize the Rails server #57

Open
Manfred opened this issue Nov 5, 2019 · 0 comments
Open

Don't daemonize the Rails server #57

Manfred opened this issue Nov 5, 2019 · 0 comments

Comments

@Manfred
Copy link
Collaborator

Manfred commented Nov 5, 2019

If we don't deamonize the Rails server we have far more direct control over the process.

Open3.popen2e(
  'rails',
  'server',
  '--environment', rails_environment,
  '--binding', rails_hostname,
  '--port', rails_port.to_s,
  chdir: app_root
) do |stdin, output, thread|
  stdin.close
  # Do things and then quit the server.
  Process.kill('TERM', thread.pid)
  # After the process stopped we can read the entire server output. This is
  # useful when debugging broken runs and possibly digging performance
  # information out of the request logs.
  logger.debug(output.read)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant