Skip to content

Don't daemonize the Rails server #57

Open
@Manfred

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions