about summary refs log tree commit homepage
path: root/bin
DateCommit message (Collapse)
2011-04-13fix some 1.9.3dev warnings
2010-10-06bin/unicorn: show "RACK_ENV" in --help
It's more descriptive as to what environment we're setting than "ENVIRONMENT".
2010-08-30remove nasty ugly hacks at startup
These nasty hacks were breaking Rubinius compatibility. This can be further cleaned up, too.
2010-08-24bin/*: more consistent --help output
This fixes a long-standing bug in the output of "unicorn_rails" where the program name was missing.
2010-06-10unicorn_rails: no need to load ActionDispatch::Static
Rails 3 will automatically load it for us.
2010-06-10respect "working_directory" wrt config.ru
Since we added support for the "working_directory" parameter, it often became unclear where/when certain paths would be bound. There are some extremely nasty dependencies and ordering issues when doing this. It's all pretty fragile, but works for now and we even have a full integration test to keep it working. I plan on cleaning this up 2.x.x to be less offensive to look at (Rainbows! and Zbatery are a bit tied to this at the moment). Thanks to Pierre Baillet for reporting this. ref: http://mid.gmane.org/AANLkTimKb7JARr_69nfVrJLvMZH3Gvs1o_KwZFLKfuxy@mail.gmail.com
2010-06-10unicorn_rails: use Kernel#warn instead of $stderr.puts
shorter is better
2010-06-08unicorn_rails: fix requires for Ruby 1.9.2
Ruby 1.9.2 no longer includes "." in $LOAD_PATH, so we need to require using an explicit path. This issue only affected Rails 3 users who chose to run without the default config.ru, as the config.ru generated by Rails 3 will call File.expand_path in the same way.
2010-06-08Fix unicorn_rails compatibility with the latest Rails 3 code
This allows us to properly detect Rails 3 installations in cases where config.ru is not present. [ew: expanded commit message fixed static file serving, more flexible regexp for matching module ] ref: mid.gmane.org/AANLkTiksBxIo_PFWoiPTWi1entXZRb7D2uE-Rl7H3lbw@mail.gmail.com Acked-by: Eric Wong <normalperson@yhbt.net>
2010-06-03unicorn_rails: avoid duplicating config.ru logic
This should allow "unicorn_rails" to be used seamlessly with Rails 3 projects which package config.ru for you.
2010-04-08bin/*: remove unnecessary listeners variable
2010-04-08unicorn_rails: rename variable for consistency
"ru" is the preferred name in Unicorn.builder, so we'll match that to make things easier to follow.
2010-04-08unicorn_rails: respect user's encoding in config.ru in 1.9
Do not assume the user wants config.ru to be Encoding::BINARY for 1.9. This is a followup to a4a8bf7604d1c15c5a8fb9cb6be37e8bccb32e52
2010-04-08unicorn_rails: use TOPLEVEL_BINDING for eval
This is to ensure there are no namespace inconsistencies
2010-02-28bin/*: remove redundant $DEBUG check
2010-02-28respect user's encoding in config.ru in 1.9
Do not assume the user wants config.ru to be Encoding::BINARY for 1.9.
2010-02-28unicorn_rails: small scoping cleanup
2010-02-28put switch parsing for config.ru into Unicorn.builder
This lets us reuse code for Zbatery and Rainbows!, too.
2010-02-25unicorn_rails: make this "working_directory"-aware
The temporary paths we create to mimic script/server-emulation did not work when working_directory was used. Now we defer path creation until after working_directory is bound.
2010-02-24unicorn_rails: avoid namespace conflicts in config.ru
We'll use our Rails-only version of Unicorn.builder so the lambda is safe without another binding.
2010-02-24unicorn_rails: make this Rails 3-compatible
The stock config/boot.rb file in a Rails 3 app is much lighter and does not export any Rails/RAILS_* constants, so we'll wait until we get config/environment.rb loaded.
2010-02-18Unicorn::builder to wrap our Rack::Builder usage
This should make it easier to reuse code in derivative servers like Rainbows! and Zbatery. Unfortunately, we can't depend on Rack::Builder/Rack::Server yet since Rack 1.1 just got them and notable frameworks (like Rails 2.3.x) do not fully work with Rack 1.1 yet). This also fixes subtle issue with config.ru files that could have variables that conflict with the Unicorn-specific namespace (this bug still affects "unicorn_rails", which could use some reworking as well).
2009-12-26exit with failure if master dies when daemonized
This behavior change also means our grandparent (launched from a controlling terminal or script) will wait until the master process is ready before returning. Thanks to IƱaki Baz Castillo for the initial implementations and inspiration.
2009-12-25bin/*: shebangs should be educational
2009-11-18Do not expand paths given on the shell
Shells already expand '~' before the executables see it, and relative paths inside symlinks can get set incorrectly to the actual directory name, and not the (usually desired) symlink name for things like Capistrano. Since our paths are now unexpanded, we must now check the "working_directory" directive and raise an error if the user specifies the config file in a way that makes the config file unreloadable.
2009-11-14old_rails: autoload Static
It makes life easier for people writing config.ru files for use with Rails.
2009-11-04bin/unicorn: allow RACK_ENV to be passed from parent
This makes our RACK_ENV handling like our RAILS_ENV handling for unicorn_rails, removing the redundant local variable.
2009-11-03bin/unicorn: set ENV["RACK_ENV"] on startup
Although not currently part of the Rack specification, ENV["RACK_ENV"] is at least a de facto standard. Some of the popular Rack servers (Thin, Passenger) and frameworks (Merb, Sinatra) already set or use it. ML-Ref: <C7A9411D-CD40-4DA4-9CB3-6AA959D2D127@larsen.st> Acked-by: Eric Wong <normalperson@yhbt.net> [ew: setenv always, not just on CLI + commit message]
2009-09-30unicorn_rails: undeprecate --path switch
..but keep -P deprecated. --path is still useful for testing ad-hoc changes when you don't want to commit your changes permanently to a configuration file.
2009-09-30rails: RAILS_RELATIVE_URL_ROOT may be set in Unicorn config
Since Unicorn config files are written in Ruby, setting RAILS_RELATIVE_URL_ROOT should be possible (and even encouraged) in the config file if it is done at all.
2009-09-24unicorn_rails: show "RAILS_ENV" in help message
This matches the manpage and the rest of the documentation.
2009-09-17launchers: deprecate ambiguous -P/--p* switches
`unicorn` tries to mimic `rackup` on the command-line to ease adoption. `unicorn_rails` tries to be somewhat like `rackup` as well, but then also tries to be consistent with `script/server` resulting some amount of confusion with regard to the -P/(--path|--pid) switch. Outright removal of these switches will probably not happen any time soon because we have command-lines inherited across processes, but we can stop advertising them. Since our (Unicorn) config file format is fortunately consistent between Rails and !Rails, recommend the "pid" directive be used instead. User interfaces are really, really tough to get right...
2009-09-17unicorn_rails: close parentheses in help message
2009-09-08"encoding: binary" comments for all sources (1.9)
This ensures any string literals that pop up in *our* code will just be a bag of bytes. This shouldn't affect/fix/break existing apps in most cases, but most constants will always have the "correct" encoding (none!) to be consistent with HTTP/socket expectations. Since this comment affects things only on a per-source basis, it won't affect existing apps with the exception of strings we pass to the Rack application. This will eventually allow us to get rid of that Unicorn::Z constant, too.
2009-08-15Remove explicit requires for Rack things
Rack is autoload-based and so are we.
2009-08-15Make launchers __END__-aware
I've noticed rackup has been __END__-aware as of 7b6046b764eafd332b3b2d9d93b3915c425fae54 in Rack upstream
2009-04-23unicorn_rails: avoid nesting lambdas
I've experienced occasional problems with this so it's probably best to stay on the safe side.
2009-04-21Remove @start_ctx instance variable
It's pointless to support multiple instances of it since this is per-process. However, the constant itself is now modifiable if anybody needs to tweak things for reexecution using a before_exec hook.
2009-04-02unicorn: remove unnecessary lambda generation
We can get by with one less lambda in the loader
2009-04-02unicorn_rails: cleanup redundant bits
There were some unnecessary lambdas in there along with some repeated checks.
2009-03-31unicorn_rails: cleanup path mapping usage
Just use the RAILS_RELATIVE_URL_ROOT variable to support it since probably works on more versions of Rails. Since no application I've ever deployed has ever used it, I'm not going to bother supporting it for Rails <2.3, either.
2009-03-31unicorn_rails: minor cleanup for dead variable
This removes half-implemented support to disable static file serving. People interested enough can provide their own config.ru file to save some stat(2) syscalls, but extra command-config options just complicate things.
2009-03-30unicorn_rails: give more info when aborting
Makes problems easier to solve if we dump the exception...
2009-03-30bin/*: parse CLI switches in config.ru sooner
This allows config.ru to specify listener and stuff before we setup the application.
2009-03-29Fix default listener setup
Combining command-line and config file options in a reasonable manner has and always will be a painful experience.
2009-03-23unicorn_rails: support non-Rack versions of Rails
This resurrects old code from Mongrel to wrap the Rails Dispatcher for older versions of Rails. It seems that Rails >= 2.2.0 support Rack, but only >=2.3 requires it. I'd like to support Rails 1.2.x for a while, too.
2009-03-20unicorn_rails: remove unnecessary Rack-loading logic
Loading Rails (or at least config/environment) will already load its version of Rack, duh! This also prevents a double-require of Rack causing redefined Rack::VERSION errors.
2009-03-19unicorn_rails: fix standard pid path setup
This was broken in the last commit (d1ff8c5): start libifying common launcher code
2009-03-19start libifying common launcher code
The daemonization logic between unicorn and unicorn_rails scripts can definitely be shared. Again: our daemonization logic is slightly non-standard since our executables are designed to run in APP_ROOT/RAILS_ROOT and not "/" like "normal" UNIX daemons.
2009-03-18Add unicorn_rails script for Rails 2.3.2
This should just run inside RAILS_ROOT out-of-the-box. No config.ru is needed (but we'll use one if it's detected). This has slightly different semantics than script/server and the normal "unicorn" script (which has "rackup"-like) semantics. It tries to combine the best of both worlds, but do not consider the command-line option interface to be stable by any means.