about summary refs log tree commit homepage
path: root/bin
DateCommit message (Collapse)
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.
2009-03-09Add -s/--server switch for compatibility with rackup
This allows config.ru files to be shared by rackup and unicorn without errors.
2009-03-09Revert "Remove -P/--pid switch from CLI"
This reverts commit 4414d9bf34f162a604d2aacc765ab1ca2fc90404.
2009-03-09Revert "exec: disable embedded switch parsing in config.ru"
This reverts commit e66ab79b8b5bc5311c750bf03868a7b2574f4ea1. Conflicts: bin/unicorn
2009-03-04Remove "directory" config option
Unicorn will always continue to run in the directory it started in, it does not chdir to "/". Since the default start_ctx[:cwd] is symlink-aware, this should not be a problem for Capistrano-deployed applications.
2009-03-04Ensure we always try to have a default listener
This is a followup to 11172f9bdcc7c57c9ae857a8088e49527a953fa1
2009-03-03require Rack as late as possible in execution
This allows LOAD_PATH modifications via the command-line (via -I or -rubygems on the command-line).
2009-03-03Allow stderr_path and stdout_path to be set in the config
As opposed to doing this in the shell, this allows the files to be reopened reliably after rotation. While we're at it, use $stderr/$stdout instead of STDERR/STDOUT since they seem to be more favored.
2009-03-03Begin to allow deferred app creation/loading
Some applications do not handle loading before forking out-of-the-box very gracefully, this starts adding support to build the Rack(-ish) application later in the process.
2009-03-03Remove unnecessary separators in help text
Doesn't seem to make a difference for 1.8 but shows up in 1.9...
2009-03-03Remove -P/--pid switch from CLI
It's confusing with the lowercase "-p" option which is more common for developers to use. PID files are only needed for production deployments, and those should be using config files anyways.
2009-03-03test for "unicorn --help" output
Ensure the output fits in a standard ANSI terminal so it's easy to read for all users regardless of what interface they're working from.
2009-03-03exec: disable embedded switch parsing in config.ru
Since not all rackup command-line options can be supported by Unicorn, disable this gross hack to avoid potentially unpredictable or undefined behavior. config.ru will not be able to specify the config file for unicorn-specific options; but the unicorn-specific config files themselves will be allowed to override the default config.ru location.
2009-02-23Allow overriding :directory or via -C/--directory
This allows Unicorn to be constantly started in symlink paths such as the ones Capistrano creates (e.g. "/u/apps/$app/current")
2009-02-21Replace unicorn binary with something rackup-like
This adds a bunch of execution tests that require the "unicorn" binary to be in PATH as well as rack being directly "require"-able ("rubygems" will not be loaded for you). The tester is responsible for setting up PATH and RUBYLIB appropriately.
2009-02-10setup.rb friendliness
2009-02-10add hot_config_file config parameter
This allows changing certain variables without restarting the master process or code reload. Currently, only the following variables are supported: @timeout, @nr_workers, @hot_config_file. Any other config changes will/should require re-executing the running binary. This config file is run through eval(); so it really users plenty of rope to hang themselves with. Of course, it requires valid Ruby syntax: ------------------------- 8< ------------------------ @nr_workers = 8 @timeout = 15 @hot_config_file = "/var/tmp/new_hot_config_file" ------------------------- 8< ------------------------ Lowering the timeout will trigger all existing workers to be gracefully stopped and restarted. This file is loaded at startup, and overrides any config settings that may already be loaded.
2009-02-09daemonization by setting UNICORN_DAEMONIZE env
Daemonization only happens once at initial startup and is less intrusive than traditional daemonize routines: we do not chdir, set umask, or redirect/close STDOUT/STDERR since those are doable via other config options with Unicorn (and the Unicorn "config file" is just Ruby). STDIN has no business being open on a daemon (and can be dangerous to close if using certain buggy third-party libs).
2009-02-09Refactor and get exec + FD inheritance working
Along with worker process management. This is nginx-style inplace upgrading (I don't know of another web server that does this). Basically we can preserve our opened listen sockets across entire executable upgrades. Signals: USR2 - Sending USR2 to the master unicorn process will cause it to exec a new master and keep the original workers running. This is useful to validate that the new code changes took place are valid and don't immediately die. Once the changes are validated (manually), you may send QUIT to the original master process to have it gracefully exit. HUP - Sending this to the master will make it immediately exec a new binary and cause the old workers to gracefully exit. Use this if you're certain the latest changes to Unicorn (and your app) are ready and don't need validating. Unlike nginx, re-execing a new binary will pick up any and all configuration changes. However listener sockets cannot be removed when exec-ing; only added (for now). I apologize for making such a big change in one commit, but once I got the ability to replace the entire codebase while preserving connections, it was too tempting to continue working. So I wrote a large chunk of this while hitting the unicorn-hello-world app with the following loop: while curl -vSsfN http://0:8080; do date +%N; done _Zero_ requests lost across multiple restarts.
2009-01-31No more throttling.
2009-01-31Merge pivotal code.
Breaks world. Added option to throttle number of concurrent threads processing requests. Conflicts: bin/mongrel_rails lib/mongrel.rb lib/mongrel/configurator.rb lib/mongrel/rails.rb test/unit/test_ws.rb
2009-01-31No commands.
2008-05-22I think that was a bug.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@1013 19e92222-5c0b-0410-8929-a290d50e31e9
2008-04-17Document issue with soft restart pid file setting (closes #29).
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@1005 19e92222-5c0b-0410-8929-a290d50e31e9
2008-04-17Apply r1003 to stable.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@1004 19e92222-5c0b-0410-8929-a290d50e31e9
2008-03-31Somehow the RUBY_PLATFORM regexp got lost between branches... great!
Added shebang to mongrel_rails (makes latest RubyGem happier). git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@1000 19e92222-5c0b-0410-8929-a290d50e31e9