Skip to content
This repository
Browse code

Fixed that script/server -d was broken so daemon mode couldn't be used

…#687 [Nicholas Seckar]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@723 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit ab3a813364c1c238728901849389bd2227ded8c2 1 parent 67a6668
David Heinemeier Hansson authored February 20, 2005
2  railties/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Fixed that script/server -d was broken so daemon mode couldn't be used #687 [Nicholas Seckar]
  4
+
3 5
 * Upgraded to breakpoint 92 which fixes:
4 6
 
5 7
     * overload IRB.parse_opts(), fixes #443
4  railties/bin/server
@@ -45,5 +45,7 @@ ENV["RAILS_ENV"] = OPTIONS[:environment]
45 45
 require File.dirname(__FILE__) + "/../config/environment"
46 46
 require 'webrick_server'
47 47
 
  48
+OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)
  49
+
48 50
 puts "=> Rails application started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
49  
-DispatchServlet.dispatch(OPTIONS)
  51
+DispatchServlet.dispatch(OPTIONS)
1  railties/lib/webrick_server.rb
@@ -18,6 +18,7 @@ def self.dispatch(options = {})
18 18
 
19 19
     trap("INT") { server.shutdown }
20 20
     server.start
  21
+    Dir::chdir(OPTIONS['working_directory']) if OPTIONS['working_directory']
21 22
   end
22 23
 
23 24
   def initialize(server, options)

0 notes on commit ab3a813

Please sign in to comment.
Something went wrong with that request. Please try again.