Closed zombiebsas closed 10 years ago
This is probably caused by e6b22d51c71bb79ac9d9a89ddcb66e8e2f5e1812 and you have a config file that does not have a listen
statement in it so unicorn inserts its default of "0.0.0.0:8080"
.
OK, this is nice, so how to call "listen" statement in config file with host and port supplied with "rails sever" command?
@dalibor983 you can try something like this:
after_fork do |server, worker| addr = "127.0.0.1:3000" server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
I actually think it make more sense to honor Rails' setting if user doesn't have listen
in their unicorn.rb
, as by ignoring that it actually make it impossible to be able to set the port using -p
option.
Let me test to see if these are the case:
listeners
like this works with configuration file.listen
in config overrides what's passing as -p
.If so, I'll submit a PR with change to make it respect rails s -p ____
.
I started looking for a clean way of detecting a listen statement was used in the unicorn config file but haven't had much time to work on it so a PR would be welcome.
@samuelkadolph would you mind reviewing #11? I think that's an adequate solution.
When I start Unicorn with:
I'm getting this error:
If I downgrade the gem version to 1.1.0, Unicorn starts working again. What am I doing wrong?