rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Andrew Bortz <andrew.bortz@gmail.com>
To: rack-devel@googlegroups.com
Subject: Fix daemonize behavior broken since 1.0.1
Date: Thu, 23 Sep 2010 14:52:14 -0700	[thread overview]
Message-ID: <AANLkTin4=M1qnWroJfrykQvdHVNf0RhMakCC+nBd_OLY@mail.gmail.com> (raw)

When rackup is run in daemonize mode, it fails to read the default
config file. In fact, it accepts a config file argument, but unless
that argument is an absolute path, it will also fail to load. The best
way I can think of to fix that is to resolve the absolute path of the
config file before the server is forked off (and chdir's to '/').

- Andrew

diff --git a/lib/rack/server.rb b/lib/rack/server.rb
index 8ef973c..edec62b 100644
--- a/lib/rack/server.rb
+++ b/lib/rack/server.rb
@@ -226,6 +226,7 @@ module Rack
        args.clear if ENV.include?("REQUEST_METHOD")

        options.merge! opt_parser.parse! args
+        options[:config] = ::File.expand_path(options[:config])
        ENV["RACK_ENV"] = options[:environment]
        options
      end

             reply	other threads:[~2010-09-24  0:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 21:52 Andrew Bortz [this message]
2010-09-24 14:15 ` Fix daemonize behavior broken since 1.0.1 James Tucker
2010-09-28  5:41   ` Andrew Bortz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTin4=M1qnWroJfrykQvdHVNf0RhMakCC+nBd_OLY@mail.gmail.com' \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).