From e9b895405f2e10d40e0feb06066d59488527b687 Mon Sep 17 00:00:00 2001 From: Ryan Duryea Date: Tue, 4 May 2010 11:49:22 -0700 Subject: [PATCH 1/2] Pass rack the absolute path of server's pid file When running as a daemon, rack will cd to "/" and paths relative to the root of the rails app aren't valid when rack is setting up. Because of this, "rails server -d" was failing silently when trying to write it's pid file --- railties/lib/rails/commands/server.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 3f74cd4..861baa2 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -83,7 +83,7 @@ module Rails :environment => (ENV['RAILS_ENV'] || "development").dup, :daemonize => false, :debugger => false, - :pid => "tmp/pids/server.pid" + :pid => File.expand_path("tmp/pids/server.pid") }) end end -- 1.7.0.4 From d154b5507216e20e6ceb33d524b134cc144f5f4b Mon Sep 17 00:00:00 2001 From: Ryan Duryea Date: Wed, 5 May 2010 11:42:10 -0700 Subject: [PATCH 2/2] Added absolute path for config.ru as well. Turns out this is also needed to fix the daemon issue under ruby 1.8.7 --- railties/lib/rails/commands/server.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 861baa2..cb9b871 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -83,7 +83,8 @@ module Rails :environment => (ENV['RAILS_ENV'] || "development").dup, :daemonize => false, :debugger => false, - :pid => File.expand_path("tmp/pids/server.pid") + :pid => File.expand_path("tmp/pids/server.pid"), + :config => File.expand_path("config.ru") }) end end -- 1.7.0.4