Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] Pass rack the absolute path of server's pid file

#4531

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.

Reported by AGuyNamedRyan · May 4th, 2010 @ 08:13 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. AGuyNamedRyan
    AGuyNamedRyan
    • 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.

    May 5th, 2010 @ 07:48 PM

  2. Dan Pickett
    Dan Pickett
    • Tag changed from patch to bugmash, patch

    May 9th, 2010 @ 06:53 PM

  3. Gavin Stark
    Gavin Stark

    +1 Works in 3.0.0beta3, applies clean to rails master 3436fd

    May 15th, 2010 @ 09:14 PM

  4. Anil Wadghule
    Anil Wadghule

    +1

    Verified bug and fix with Rails master 6617d018937. Patch gets applied cleanly.

    May 15th, 2010 @ 10:15 PM

  5. Enrico Bianco
    Enrico Bianco

    +1

    Verified bug, patch applies cleanly to current Rails master (3afdfc35...) and rails s -d no longer fails silently.

    May 16th, 2010 @ 12:52 AM

  6. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to José Valim

    The issue still exists in master.

    +1 to the patch, applies cleanly and fixes the problem.

    June 15th, 2010 @ 10:26 AM

  7. Rohit Arondekar