samuelkadolph / unicorn-rails

unicorn-rails is a simple gem that sets the default server for rack (and rails) to unicorn.
MIT License
127 stars 22 forks source link

Adding support for -P option for `rails server`. #19

Open ProGM opened 9 years ago

ProGM commented 9 years ago

Hello! This change allows to use the --pid/-P option in rails server.

Example:

rails server -P tmp/pids/server.pid
apalmblad commented 9 years ago

Looks good to me, was looking to add this myself.

The touching of the file threw me a bit, but it seems that the unicorn server will give a stale pid error message if it's not there. Not exactly sure why; there's nothing obvious causing it... https://github.com/defunkt/unicorn/blob/master/lib/unicorn/http_server.rb#L185