unicorn-maintained 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.CHANGELOG.old +25 -0
- data/.document +28 -0
- data/.gitattributes +5 -0
- data/.gitignore +25 -0
- data/.mailmap +26 -0
- data/.manifest +149 -0
- data/.olddoc.yml +25 -0
- data/Application_Timeouts +77 -0
- data/CONTRIBUTORS +39 -0
- data/COPYING +674 -0
- data/DESIGN +99 -0
- data/Documentation/.gitignore +3 -0
- data/Documentation/unicorn.1 +222 -0
- data/Documentation/unicorn_rails.1 +207 -0
- data/FAQ +70 -0
- data/GIT-VERSION-FILE +1 -0
- data/GIT-VERSION-GEN +39 -0
- data/GNUmakefile +317 -0
- data/HACKING +112 -0
- data/ISSUES +102 -0
- data/KNOWN_ISSUES +79 -0
- data/LATEST +1 -0
- data/LICENSE +67 -0
- data/Links +58 -0
- data/NEWS +1 -0
- data/PHILOSOPHY +139 -0
- data/README +156 -0
- data/Rakefile +16 -0
- data/SIGNALS +123 -0
- data/Sandbox +104 -0
- data/TODO +3 -0
- data/TUNING +119 -0
- data/archive/.gitignore +3 -0
- data/archive/slrnpull.conf +4 -0
- data/bin/unicorn +128 -0
- data/bin/unicorn_rails +209 -0
- data/examples/big_app_gc.rb +2 -0
- data/examples/echo.ru +26 -0
- data/examples/init.sh +102 -0
- data/examples/logger_mp_safe.rb +25 -0
- data/examples/logrotate.conf +44 -0
- data/examples/nginx.conf +156 -0
- data/examples/unicorn.conf.minimal.rb +13 -0
- data/examples/unicorn.conf.rb +110 -0
- data/examples/unicorn.socket +11 -0
- data/examples/unicorn@.service +40 -0
- data/ext/unicorn_http/CFLAGS +13 -0
- data/ext/unicorn_http/c_util.h +116 -0
- data/ext/unicorn_http/common_field_optimization.h +128 -0
- data/ext/unicorn_http/epollexclusive.h +128 -0
- data/ext/unicorn_http/ext_help.h +38 -0
- data/ext/unicorn_http/extconf.rb +39 -0
- data/ext/unicorn_http/global_variables.h +97 -0
- data/ext/unicorn_http/httpdate.c +91 -0
- data/ext/unicorn_http/unicorn_http.c +4334 -0
- data/ext/unicorn_http/unicorn_http.rl +1040 -0
- data/ext/unicorn_http/unicorn_http_common.rl +76 -0
- data/lib/unicorn/app/old_rails/static.rb +59 -0
- data/lib/unicorn/app/old_rails.rb +35 -0
- data/lib/unicorn/cgi_wrapper.rb +147 -0
- data/lib/unicorn/configurator.rb +748 -0
- data/lib/unicorn/const.rb +21 -0
- data/lib/unicorn/http_request.rb +201 -0
- data/lib/unicorn/http_response.rb +93 -0
- data/lib/unicorn/http_server.rb +859 -0
- data/lib/unicorn/launcher.rb +62 -0
- data/lib/unicorn/oob_gc.rb +81 -0
- data/lib/unicorn/preread_input.rb +33 -0
- data/lib/unicorn/select_waiter.rb +6 -0
- data/lib/unicorn/socket_helper.rb +185 -0
- data/lib/unicorn/stream_input.rb +151 -0
- data/lib/unicorn/tee_input.rb +131 -0
- data/lib/unicorn/tmpio.rb +33 -0
- data/lib/unicorn/util.rb +90 -0
- data/lib/unicorn/version.rb +1 -0
- data/lib/unicorn/worker.rb +165 -0
- data/lib/unicorn.rb +136 -0
- data/man/man1/unicorn.1 +222 -0
- data/man/man1/unicorn_rails.1 +207 -0
- data/setup.rb +1586 -0
- data/t/.gitignore +4 -0
- data/t/GNUmakefile +5 -0
- data/t/README +49 -0
- data/t/active-unix-socket.t +117 -0
- data/t/bin/unused_listen +40 -0
- data/t/broken-app.ru +12 -0
- data/t/client_body_buffer_size.ru +14 -0
- data/t/client_body_buffer_size.t +80 -0
- data/t/detach.ru +11 -0
- data/t/env.ru +3 -0
- data/t/fails-rack-lint.ru +5 -0
- data/t/heartbeat-timeout.ru +12 -0
- data/t/heartbeat-timeout.t +62 -0
- data/t/integration.ru +115 -0
- data/t/integration.t +356 -0
- data/t/lib.perl +258 -0
- data/t/listener_names.ru +4 -0
- data/t/my-tap-lib.sh +201 -0
- data/t/oob_gc.ru +17 -0
- data/t/oob_gc_path.ru +17 -0
- data/t/pid.ru +3 -0
- data/t/preread_input.ru +22 -0
- data/t/reload-bad-config.t +54 -0
- data/t/reopen-logs.ru +13 -0
- data/t/reopen-logs.t +39 -0
- data/t/t0008-back_out_of_upgrade.sh +110 -0
- data/t/t0009-broken-app.sh +56 -0
- data/t/t0010-reap-logging.sh +55 -0
- data/t/t0012-reload-empty-config.sh +86 -0
- data/t/t0013-rewindable-input-false.sh +24 -0
- data/t/t0013.ru +12 -0
- data/t/t0014-rewindable-input-true.sh +24 -0
- data/t/t0014.ru +12 -0
- data/t/t0015-configurator-internals.sh +25 -0
- data/t/t0020-at_exit-handler.sh +49 -0
- data/t/t0021-process_detach.sh +29 -0
- data/t/t0022-listener_names-preload_app.sh +32 -0
- data/t/t0300-no-default-middleware.sh +20 -0
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- data/t/t9001-oob_gc.sh +47 -0
- data/t/t9002-oob_gc-path.sh +75 -0
- data/t/test-lib.sh +125 -0
- data/t/winch_ttin.t +67 -0
- data/t/working_directory.t +94 -0
- data/test/aggregate.rb +15 -0
- data/test/benchmark/README +60 -0
- data/test/benchmark/dd.ru +18 -0
- data/test/benchmark/ddstream.ru +50 -0
- data/test/benchmark/readinput.ru +40 -0
- data/test/benchmark/stack.ru +8 -0
- data/test/benchmark/uconnect.perl +66 -0
- data/test/exec/README +5 -0
- data/test/exec/test_exec.rb +1029 -0
- data/test/test_helper.rb +306 -0
- data/test/unit/test_ccc.rb +91 -0
- data/test/unit/test_configurator.rb +175 -0
- data/test/unit/test_droplet.rb +28 -0
- data/test/unit/test_http_parser.rb +884 -0
- data/test/unit/test_http_parser_ng.rb +714 -0
- data/test/unit/test_request.rb +169 -0
- data/test/unit/test_server.rb +244 -0
- data/test/unit/test_signals.rb +188 -0
- data/test/unit/test_socket_helper.rb +159 -0
- data/test/unit/test_stream_input.rb +210 -0
- data/test/unit/test_tee_input.rb +303 -0
- data/test/unit/test_util.rb +131 -0
- data/test/unit/test_waiter.rb +34 -0
- data/unicorn.gemspec +48 -0
- metadata +275 -0
@@ -0,0 +1,207 @@
|
|
1
|
+
.TH "UNICORN_RAILS" "1" "September 17, 2009" "Unicorn User Manual" ""
|
2
|
+
.hy
|
3
|
+
.SH NAME
|
4
|
+
.PP
|
5
|
+
unicorn_rails \- unicorn launcher for Rails 1.x and 2.x users
|
6
|
+
.SH SYNOPSIS
|
7
|
+
.PP
|
8
|
+
unicorn_rails [\-c CONFIG_FILE] [\-E RAILS_ENV] [\-D] [RACKUP_FILE]
|
9
|
+
.SH DESCRIPTION
|
10
|
+
.PP
|
11
|
+
A rackup(1)\-like command to launch ancient Rails (2.x and earlier)
|
12
|
+
applications using Unicorn. Rails 3 (and later) support Rack natively,
|
13
|
+
so users are encouraged to use unicorn(1) instead of unicorn_rails(1).
|
14
|
+
.PP
|
15
|
+
It is expected to be started in your Rails application root (RAILS_ROOT),
|
16
|
+
but the "working_directory" directive may be used in the CONFIG_FILE.
|
17
|
+
.PP
|
18
|
+
The outward interface resembles rackup(1), the internals and default
|
19
|
+
middleware loading is designed like the \f[C]script/server\f[] command
|
20
|
+
distributed with Rails.
|
21
|
+
.PP
|
22
|
+
While Unicorn takes a myriad of command\-line options for compatibility
|
23
|
+
with ruby(1) and rackup(1), it is recommended to stick to the few
|
24
|
+
command\-line options specified in the SYNOPSIS and use the CONFIG_FILE
|
25
|
+
as much as possible.
|
26
|
+
.SH UNICORN OPTIONS
|
27
|
+
.TP
|
28
|
+
.B \-c, \-\-config\-file CONFIG_FILE
|
29
|
+
Path to the Unicorn\-specific config file. The config file is
|
30
|
+
implemented as a Ruby DSL, so Ruby code may executed.
|
31
|
+
See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the full
|
32
|
+
list of directives available from the DSL.
|
33
|
+
Using an absolute path for for CONFIG_FILE is recommended as it
|
34
|
+
makes multiple instances of Unicorn easily distinguishable when
|
35
|
+
viewing ps(1) output.
|
36
|
+
.RS
|
37
|
+
.RE
|
38
|
+
.TP
|
39
|
+
.B \-D, \-\-daemonize
|
40
|
+
Run daemonized in the background. The process is detached from
|
41
|
+
the controlling terminal and stdin is redirected to "/dev/null".
|
42
|
+
Unlike many common UNIX daemons, we do not chdir to "/" upon
|
43
|
+
daemonization to allow more control over the startup/upgrade
|
44
|
+
process.
|
45
|
+
Unless specified in the CONFIG_FILE, stderr and stdout will
|
46
|
+
also be redirected to "/dev/null".
|
47
|
+
Daemonization will \f[I]skip\f[] loading of the
|
48
|
+
\f[I]Rails::Rack::LogTailer\f[]
|
49
|
+
middleware under Rails >= 2.3.x.
|
50
|
+
By default, unicorn_rails(1) will create a PID file in
|
51
|
+
\f[I]"RAILS_ROOT/tmp/pids/unicorn.pid"\f[]. You may override this
|
52
|
+
by specifying the "pid" directive to override this Unicorn config file.
|
53
|
+
.RS
|
54
|
+
.RE
|
55
|
+
.TP
|
56
|
+
.B \-E, \-\-env RAILS_ENV
|
57
|
+
Run under the given RAILS_ENV. This sets the RAILS_ENV environment
|
58
|
+
variable. Acceptable values are exactly those you expect in your Rails
|
59
|
+
application, typically "development" or "production".
|
60
|
+
.RS
|
61
|
+
.RE
|
62
|
+
.TP
|
63
|
+
.B \-l, \-\-listen ADDRESS
|
64
|
+
Listens on a given ADDRESS. ADDRESS may be in the form of
|
65
|
+
HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
|
66
|
+
and PATH is meant to be a path to a UNIX domain socket.
|
67
|
+
Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080).
|
68
|
+
For production deployments, specifying the "listen" directive in
|
69
|
+
CONFIG_FILE is recommended as it allows fine\-tuning of socket
|
70
|
+
options.
|
71
|
+
.RS
|
72
|
+
.RE
|
73
|
+
.SH RACKUP COMPATIBILITY OPTIONS
|
74
|
+
.TP
|
75
|
+
.B \-o, \-\-host HOST
|
76
|
+
Listen on a TCP socket belonging to HOST, default is
|
77
|
+
"0.0.0.0" (all addresses).
|
78
|
+
If specified multiple times on the command\-line, only the
|
79
|
+
last\-specified value takes effect.
|
80
|
+
This option only exists for compatibility with the rackup(1) command,
|
81
|
+
use of "\-l"/"\-\-listen" switch is recommended instead.
|
82
|
+
.RS
|
83
|
+
.RE
|
84
|
+
.TP
|
85
|
+
.B \-p, \-\-port PORT
|
86
|
+
Listen on the specified TCP PORT, default is 8080.
|
87
|
+
If specified multiple times on the command\-line, only the last\-specified
|
88
|
+
value takes effect.
|
89
|
+
This option only exists for compatibility with the rackup(1) command,
|
90
|
+
use of "\-l"/"\-\-listen" switch is recommended instead.
|
91
|
+
.RS
|
92
|
+
.RE
|
93
|
+
.TP
|
94
|
+
.B \-\-path PATH
|
95
|
+
Mounts the Rails application at the given PATH (instead of "/").
|
96
|
+
This is equivalent to setting the RAILS_RELATIVE_URL_ROOT
|
97
|
+
environment variable. This is only supported under Rails 2.3
|
98
|
+
or later at the moment.
|
99
|
+
.RS
|
100
|
+
.RE
|
101
|
+
.SH RUBY OPTIONS
|
102
|
+
.TP
|
103
|
+
.B \-e, \-\-eval LINE
|
104
|
+
Evaluate a LINE of Ruby code. This evaluation happens
|
105
|
+
immediately as the command\-line is being parsed.
|
106
|
+
.RS
|
107
|
+
.RE
|
108
|
+
.TP
|
109
|
+
.B \-d, \-\-debug
|
110
|
+
Turn on debug mode, the $DEBUG variable is set to true.
|
111
|
+
For Rails >= 2.3.x, this loads the \f[I]Rails::Rack::Debugger\f[]
|
112
|
+
middleware.
|
113
|
+
.RS
|
114
|
+
.RE
|
115
|
+
.TP
|
116
|
+
.B \-w, \-\-warn
|
117
|
+
Turn on verbose warnings, the $VERBOSE variable is set to true.
|
118
|
+
.RS
|
119
|
+
.RE
|
120
|
+
.TP
|
121
|
+
.B \-I, \-\-include PATH
|
122
|
+
specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
|
123
|
+
The \[aq]:\[aq] character may be used to delimit multiple directories.
|
124
|
+
This directive may be used more than once. Modifications to
|
125
|
+
$LOAD_PATH take place immediately and in the order they were
|
126
|
+
specified on the command\-line.
|
127
|
+
.RS
|
128
|
+
.RE
|
129
|
+
.TP
|
130
|
+
.B \-r, \-\-require LIBRARY
|
131
|
+
require a specified LIBRARY before executing the application. The
|
132
|
+
"require" statement will be executed immediately and in the order
|
133
|
+
they were specified on the command\-line.
|
134
|
+
.RS
|
135
|
+
.RE
|
136
|
+
.SH RACKUP FILE
|
137
|
+
.PP
|
138
|
+
This defaults to "config.ru" in RAILS_ROOT. It should be the same
|
139
|
+
file used by rackup(1) and other Rack launchers, it uses the
|
140
|
+
\f[I]Rack::Builder\f[] DSL. Unlike many other Rack applications, RACKUP_FILE
|
141
|
+
is completely \f[I]optional\f[] for Rails, but may be used to disable
|
142
|
+
some of the default middleware for performance.
|
143
|
+
.PP
|
144
|
+
Embedded command\-line options are mostly parsed for compatibility
|
145
|
+
with rackup(1) but strongly discouraged.
|
146
|
+
.SH ENVIRONMENT VARIABLES
|
147
|
+
.PP
|
148
|
+
The RAILS_ENV variable is set by the aforementioned \-E switch. The
|
149
|
+
RAILS_RELATIVE_URL_ROOT is set by the aforementioned \-\-path switch.
|
150
|
+
Either of these variables may also be set in the shell or the Unicorn
|
151
|
+
CONFIG_FILE. All application or library\-specific environment variables
|
152
|
+
(e.g. TMPDIR, RAILS_ASSET_ID) may always be set in the Unicorn
|
153
|
+
CONFIG_FILE in addition to the spawning shell. When transparently
|
154
|
+
upgrading Unicorn, all environment variables set in the old master
|
155
|
+
process are inherited by the new master process. Unicorn only uses (and
|
156
|
+
will overwrite) the UNICORN_FD environment variable internally when
|
157
|
+
doing transparent upgrades.
|
158
|
+
.SH SIGNALS
|
159
|
+
.PP
|
160
|
+
The following UNIX signals may be sent to the master process:
|
161
|
+
.IP \[bu] 2
|
162
|
+
HUP \- reload config file, app, and gracefully restart all workers
|
163
|
+
.IP \[bu] 2
|
164
|
+
INT/TERM \- quick shutdown, kills all workers immediately
|
165
|
+
.IP \[bu] 2
|
166
|
+
QUIT \- graceful shutdown, waits for workers to finish their current
|
167
|
+
request before finishing.
|
168
|
+
.IP \[bu] 2
|
169
|
+
USR1 \- reopen all logs owned by the master and all workers
|
170
|
+
See Unicorn::Util.reopen_logs for what is considered a log.
|
171
|
+
.IP \[bu] 2
|
172
|
+
USR2 \- reexecute the running binary. A separate QUIT
|
173
|
+
should be sent to the original process once the child is verified to
|
174
|
+
be up and running.
|
175
|
+
.IP \[bu] 2
|
176
|
+
WINCH \- gracefully stops workers but keep the master running.
|
177
|
+
This will only work for daemonized processes.
|
178
|
+
.IP \[bu] 2
|
179
|
+
TTIN \- increment the number of worker processes by one
|
180
|
+
.IP \[bu] 2
|
181
|
+
TTOU \- decrement the number of worker processes by one
|
182
|
+
.PP
|
183
|
+
See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
|
184
|
+
full description of all signals used by Unicorn.
|
185
|
+
.SH SEE ALSO
|
186
|
+
.IP \[bu] 2
|
187
|
+
unicorn(1)
|
188
|
+
.IP \[bu] 2
|
189
|
+
\f[I]Rack::Builder\f[] ri/RDoc
|
190
|
+
.IP \[bu] 2
|
191
|
+
\f[I]Unicorn::Configurator\f[] ri/RDoc
|
192
|
+
.UR https://yhbt.net/unicorn/Unicorn/Configurator.html
|
193
|
+
.UE
|
194
|
+
.IP \[bu] 2
|
195
|
+
unicorn RDoc
|
196
|
+
.UR https://yhbt.net/unicorn/
|
197
|
+
.UE
|
198
|
+
.IP \[bu] 2
|
199
|
+
Rack RDoc
|
200
|
+
.UR https://www.rubydoc.info/github/rack/rack/
|
201
|
+
.UE
|
202
|
+
.IP \[bu] 2
|
203
|
+
Rackup HowTo
|
204
|
+
.UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
|
205
|
+
.UE
|
206
|
+
.SH AUTHORS
|
207
|
+
The Unicorn Community <unicorn-public@yhbt.net>.
|