This project is archived and is in readonly mode.
[PATCH] Pass rack the absolute path of server's pid file
Reported by AGuyNamedRyan | May 4th, 2010 @ 08:13 PM
The command "rails server --daemon" fails silently and dies under ruby < 1.9
As mentioned here in a closed rack ticket, rack will chdir to "/" when running as a daemon. Rails uses "tmp/pids/server.pid", a relative path, as the path to the pid file. Once rack has daemonized and chdir to "/", this path is invalid and the process dies silently.
I've attached a patch which uses the absolute path of the pid file instead of the path relative to the root of the rails app.
The aforementioned ticket mentions that the config argument should also be an absolute path, but I didn't need to make that change in order for "rails server -d" to work.
Comments and changes to this ticket
-
AGuyNamedRyan May 5th, 2010 @ 07:48 PM
- Tag set to patch
Turns out I was wrong. The config.ru file also needs to be passed in as an absolute path. I've submitted a new patch that does this.
-
Dan Pickett May 9th, 2010 @ 06:53 PM
- Tag changed from patch to bugmash, patch
-
Anil Wadghule May 15th, 2010 @ 10:15 PM
+1
Verified bug and fix with Rails master 6617d018937. Patch gets applied cleanly.
-
Enrico Bianco May 16th, 2010 @ 12:52 AM
+1
Verified bug, patch applies cleanly to current Rails master (3afdfc35...) and
rails s -d
no longer fails silently. -
Rohit Arondekar June 15th, 2010 @ 10:26 AM
- Assigned user set to José Valim
The issue still exists in master.
+1 to the patch, applies cleanly and fixes the problem.
-
Rohit Arondekar June 20th, 2010 @ 03:56 AM
- State changed from new to resolved
Patch was applied here http://github.com/rails/rails/commit/73df48083a8e0bdb10752c1b481549...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>