Date | Commit message (Collapse) |
|
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.
|
|
This allows config.ru files to be shared by rackup and
unicorn without errors.
|
|
This reverts commit 4414d9bf34f162a604d2aacc765ab1ca2fc90404.
|
|
This reverts commit e66ab79b8b5bc5311c750bf03868a7b2574f4ea1.
Conflicts:
bin/unicorn
|
|
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.
|
|
This is a followup to 11172f9bdcc7c57c9ae857a8088e49527a953fa1
|
|
This allows LOAD_PATH modifications via the command-line
(via -I or -rubygems on the command-line).
|
|
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.
|
|
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.
|
|
Doesn't seem to make a difference for 1.8
but shows up in 1.9...
|
|
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.
|
|
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.
|
|
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.
|
|
This allows Unicorn to be constantly started in symlink
paths such as the ones Capistrano creates
(e.g. "/u/apps/$app/current")
|
|
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.
|
|
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).
|
|
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.
|