unicorn 5.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.manifest +11 -5
- data/.olddoc.yml +16 -6
- data/Application_Timeouts +4 -4
- data/CONTRIBUTORS +6 -2
- data/Documentation/.gitignore +1 -3
- data/Documentation/unicorn.1 +222 -0
- data/Documentation/unicorn_rails.1 +207 -0
- data/FAQ +1 -1
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +118 -58
- data/HACKING +2 -10
- data/ISSUES +40 -35
- data/KNOWN_ISSUES +2 -2
- data/LATEST +23 -28
- data/LICENSE +2 -2
- data/Links +13 -11
- data/NEWS +612 -0
- data/README +30 -29
- data/SIGNALS +1 -1
- data/Sandbox +8 -7
- data/TODO +0 -2
- data/TUNING +19 -1
- data/archive/slrnpull.conf +1 -1
- data/bin/unicorn +3 -1
- data/bin/unicorn_rails +2 -2
- data/examples/big_app_gc.rb +1 -1
- data/examples/init.sh +36 -8
- data/examples/logrotate.conf +17 -2
- data/examples/nginx.conf +4 -3
- data/examples/unicorn.conf.minimal.rb +2 -2
- data/examples/unicorn.conf.rb +2 -2
- data/examples/unicorn@.service +14 -0
- data/ext/unicorn_http/c_util.h +5 -13
- data/ext/unicorn_http/common_field_optimization.h +22 -5
- data/ext/unicorn_http/epollexclusive.h +124 -0
- data/ext/unicorn_http/ext_help.h +0 -44
- data/ext/unicorn_http/extconf.rb +32 -6
- data/ext/unicorn_http/global_variables.h +2 -2
- data/ext/unicorn_http/httpdate.c +2 -1
- data/ext/unicorn_http/unicorn_http.c +853 -498
- data/ext/unicorn_http/unicorn_http.rl +86 -30
- data/ext/unicorn_http/unicorn_http_common.rl +1 -1
- data/lib/unicorn/configurator.rb +93 -13
- data/lib/unicorn/http_request.rb +101 -11
- data/lib/unicorn/http_response.rb +8 -4
- data/lib/unicorn/http_server.rb +141 -72
- data/lib/unicorn/launcher.rb +1 -1
- data/lib/unicorn/oob_gc.rb +6 -6
- data/lib/unicorn/select_waiter.rb +6 -0
- data/lib/unicorn/socket_helper.rb +23 -7
- data/lib/unicorn/stream_input.rb +5 -4
- data/lib/unicorn/tee_input.rb +8 -10
- data/lib/unicorn/tmpio.rb +8 -2
- data/lib/unicorn/util.rb +3 -3
- data/lib/unicorn/version.rb +1 -1
- data/lib/unicorn/worker.rb +33 -8
- data/lib/unicorn.rb +55 -29
- data/man/man1/unicorn.1 +120 -118
- data/man/man1/unicorn_rails.1 +106 -107
- data/t/GNUmakefile +3 -72
- data/t/README +4 -4
- data/t/t0011-active-unix-socket.sh +1 -1
- data/t/t0012-reload-empty-config.sh +2 -1
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- data/t/test-lib.sh +4 -3
- data/test/benchmark/README +14 -4
- data/test/benchmark/ddstream.ru +50 -0
- data/test/benchmark/readinput.ru +40 -0
- data/test/benchmark/uconnect.perl +66 -0
- data/test/exec/test_exec.rb +26 -24
- data/test/test_helper.rb +38 -30
- data/test/unit/test_ccc.rb +91 -0
- data/test/unit/test_droplet.rb +1 -1
- data/test/unit/test_http_parser.rb +46 -16
- data/test/unit/test_http_parser_ng.rb +81 -0
- data/test/unit/test_request.rb +10 -10
- data/test/unit/test_server.rb +86 -12
- data/test/unit/test_signals.rb +8 -8
- data/test/unit/test_socket_helper.rb +13 -9
- data/test/unit/test_upload.rb +9 -14
- data/test/unit/test_util.rb +31 -5
- data/test/unit/test_waiter.rb +34 -0
- data/unicorn.gemspec +21 -22
- metadata +21 -28
- data/Documentation/GNUmakefile +0 -30
- data/Documentation/unicorn.1.txt +0 -188
- data/Documentation/unicorn_rails.1.txt +0 -175
- data/t/hijack.ru +0 -43
- data/t/t0200-rack-hijack.sh +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cd2fc6250af1faf8048df529538386a6974dcbd1aac58db683a710b804bae1e8
|
4
|
+
data.tar.gz: 50aeca90aada5aeb9869cf3885681fe9029bee6183c99c8b85afb3d0803b479f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ebf917cc17380114648c22f9cb3ad59bda6125d23781e64cd89bb8936bf17bc6bb7292933f9433f1397901022683a63b241d512b31ea1b85e5bc791a10a74e
|
7
|
+
data.tar.gz: d36730df71b5b131de61037f2838b743d587b93b1eeb70eea1956de4aabc9051485626d38debaadd3d5c3ee3c2738ca72f9a9cbc9bafb6eff9e11f08ad272275
|
data/.manifest
CHANGED
@@ -10,9 +10,8 @@ CONTRIBUTORS
|
|
10
10
|
COPYING
|
11
11
|
DESIGN
|
12
12
|
Documentation/.gitignore
|
13
|
-
Documentation/
|
14
|
-
Documentation/
|
15
|
-
Documentation/unicorn_rails.1.txt
|
13
|
+
Documentation/unicorn.1
|
14
|
+
Documentation/unicorn_rails.1
|
16
15
|
FAQ
|
17
16
|
GIT-VERSION-FILE
|
18
17
|
GIT-VERSION-GEN
|
@@ -48,6 +47,7 @@ examples/unicorn@.service
|
|
48
47
|
ext/unicorn_http/CFLAGS
|
49
48
|
ext/unicorn_http/c_util.h
|
50
49
|
ext/unicorn_http/common_field_optimization.h
|
50
|
+
ext/unicorn_http/epollexclusive.h
|
51
51
|
ext/unicorn_http/ext_help.h
|
52
52
|
ext/unicorn_http/extconf.rb
|
53
53
|
ext/unicorn_http/global_variables.h
|
@@ -67,6 +67,7 @@ lib/unicorn/http_server.rb
|
|
67
67
|
lib/unicorn/launcher.rb
|
68
68
|
lib/unicorn/oob_gc.rb
|
69
69
|
lib/unicorn/preread_input.rb
|
70
|
+
lib/unicorn/select_waiter.rb
|
70
71
|
lib/unicorn/socket_helper.rb
|
71
72
|
lib/unicorn/stream_input.rb
|
72
73
|
lib/unicorn/tee_input.rb
|
@@ -88,7 +89,6 @@ t/detach.ru
|
|
88
89
|
t/env.ru
|
89
90
|
t/fails-rack-lint.ru
|
90
91
|
t/heartbeat-timeout.ru
|
91
|
-
t/hijack.ru
|
92
92
|
t/listener_names.ru
|
93
93
|
t/my-tap-lib.sh
|
94
94
|
t/oob_gc.ru
|
@@ -126,8 +126,9 @@ t/t0022-listener_names-preload_app.sh
|
|
126
126
|
t/t0100-rack-input-tests.sh
|
127
127
|
t/t0116-client_body_buffer_size.sh
|
128
128
|
t/t0116.ru
|
129
|
-
t/t0200-rack-hijack.sh
|
130
129
|
t/t0300-no-default-middleware.sh
|
130
|
+
t/t0301-no-default-middleware-ignored-in-config.sh
|
131
|
+
t/t0301.ru
|
131
132
|
t/t9000-preread-input.sh
|
132
133
|
t/t9001-oob_gc.sh
|
133
134
|
t/t9002-oob_gc-path.sh
|
@@ -136,10 +137,14 @@ t/write-on-close.ru
|
|
136
137
|
test/aggregate.rb
|
137
138
|
test/benchmark/README
|
138
139
|
test/benchmark/dd.ru
|
140
|
+
test/benchmark/ddstream.ru
|
141
|
+
test/benchmark/readinput.ru
|
139
142
|
test/benchmark/stack.ru
|
143
|
+
test/benchmark/uconnect.perl
|
140
144
|
test/exec/README
|
141
145
|
test/exec/test_exec.rb
|
142
146
|
test/test_helper.rb
|
147
|
+
test/unit/test_ccc.rb
|
143
148
|
test/unit/test_configurator.rb
|
144
149
|
test/unit/test_droplet.rb
|
145
150
|
test/unit/test_http_parser.rb
|
@@ -153,4 +158,5 @@ test/unit/test_stream_input.rb
|
|
153
158
|
test/unit/test_tee_input.rb
|
154
159
|
test/unit/test_upload.rb
|
155
160
|
test/unit/test_util.rb
|
161
|
+
test/unit/test_waiter.rb
|
156
162
|
unicorn.gemspec
|
data/.olddoc.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
---
|
2
|
-
cgit_url:
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
cgit_url: https://yhbt.net/unicorn.git
|
3
|
+
rdoc_url: https://yhbt.net/unicorn/
|
4
|
+
ml_url:
|
5
|
+
- https://yhbt.net/unicorn-public/
|
6
|
+
- http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/unicorn-public/
|
6
7
|
merge_html:
|
7
8
|
unicorn_1: Documentation/unicorn.1.html
|
8
9
|
unicorn_rails_1: Documentation/unicorn_rails.1.html
|
@@ -11,5 +12,14 @@ noindex:
|
|
11
12
|
- LATEST
|
12
13
|
- TODO
|
13
14
|
- unicorn_rails_1
|
14
|
-
public_email: unicorn-public@
|
15
|
-
|
15
|
+
public_email: unicorn-public@yhbt.net
|
16
|
+
imap_url:
|
17
|
+
- imaps://yhbt.net/inbox.comp.lang.ruby.unicorn.0
|
18
|
+
- imap://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.unicorn.0
|
19
|
+
nntp_url:
|
20
|
+
- nntps://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
|
21
|
+
- nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.unicorn
|
22
|
+
- nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
|
23
|
+
source_code:
|
24
|
+
- git clone https://yhbt.net/unicorn.git
|
25
|
+
- torsocks git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/unicorn.git
|
data/Application_Timeouts
CHANGED
@@ -23,10 +23,10 @@ Most database adapters allow configurable timeouts.
|
|
23
23
|
Net::HTTP and Net::SMTP in the Ruby standard library allow
|
24
24
|
configurable timeouts.
|
25
25
|
|
26
|
-
Even for things as fast as {memcached}[
|
27
|
-
{dalli}[
|
28
|
-
{memcached}[
|
29
|
-
{memcache-client}[
|
26
|
+
Even for things as fast as {memcached}[https://memcached.org/],
|
27
|
+
{dalli}[https://rubygems.org/gems/dalli],
|
28
|
+
{memcached}[https://rubygems.org/gems/memcached] and
|
29
|
+
{memcache-client}[https://rubygems.org/gems/memcache-client] RubyGems all
|
30
30
|
offer configurable timeouts.
|
31
31
|
|
32
32
|
Consult the relevant documentation for the libraries you use on
|
data/CONTRIBUTORS
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
Unicorn developers (let us know if we forgot you
|
2
|
-
|
1
|
+
Unicorn developers (let us know if we forgot you, ...or if you no longer wish
|
2
|
+
to be associated with the doofus running this disaster :P):
|
3
|
+
* Eric Wong (Bozo Doofus For Life, Bastard Operator From Hell)
|
4
|
+
|
5
|
+
There's numerous contributors over email the years, all of our mail
|
6
|
+
is archived @ https://yhbt.net/unicorn-public/
|
3
7
|
* Suraj N. Kurapati
|
4
8
|
* Andrey Stikheev
|
5
9
|
* Wayne Larsen
|
data/Documentation/.gitignore
CHANGED
@@ -0,0 +1,222 @@
|
|
1
|
+
.TH "UNICORN" "1" "September 15, 2009" "Unicorn User Manual" ""
|
2
|
+
.hy
|
3
|
+
.SH NAME
|
4
|
+
.PP
|
5
|
+
unicorn \- a rackup\-like command to launch the Unicorn HTTP server
|
6
|
+
.SH SYNOPSIS
|
7
|
+
.PP
|
8
|
+
unicorn [\-c CONFIG_FILE] [\-E RACK_ENV] [\-D] [RACKUP_FILE]
|
9
|
+
.SH DESCRIPTION
|
10
|
+
.PP
|
11
|
+
A rackup(1)\-like command to launch Rack applications using Unicorn.
|
12
|
+
It is expected to be started in your application root (APP_ROOT),
|
13
|
+
but the "working_directory" directive may be used in the CONFIG_FILE.
|
14
|
+
.PP
|
15
|
+
While unicorn takes a myriad of command\-line options for
|
16
|
+
compatibility with ruby(1) and rackup(1), it is recommended to stick
|
17
|
+
to the few command\-line options specified in the SYNOPSIS and use
|
18
|
+
the CONFIG_FILE as much as possible.
|
19
|
+
.SH RACKUP FILE
|
20
|
+
.PP
|
21
|
+
This defaults to "config.ru" in APP_ROOT. It should be the same
|
22
|
+
file used by rackup(1) and other Rack launchers, it uses the
|
23
|
+
\f[I]Rack::Builder\f[] DSL.
|
24
|
+
.PP
|
25
|
+
Embedded command\-line options are mostly parsed for compatibility
|
26
|
+
with rackup(1) but strongly discouraged.
|
27
|
+
.SH UNICORN OPTIONS
|
28
|
+
.TP
|
29
|
+
.B \-c, \-\-config\-file CONFIG_FILE
|
30
|
+
Path to the Unicorn\-specific config file. The config file is
|
31
|
+
implemented as a Ruby DSL, so Ruby code may executed.
|
32
|
+
See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the full
|
33
|
+
list of directives available from the DSL.
|
34
|
+
Using an absolute path for for CONFIG_FILE is recommended as it
|
35
|
+
makes multiple instances of Unicorn easily distinguishable when
|
36
|
+
viewing ps(1) output.
|
37
|
+
.RS
|
38
|
+
.RE
|
39
|
+
.TP
|
40
|
+
.B \-D, \-\-daemonize
|
41
|
+
Run daemonized in the background. The process is detached from
|
42
|
+
the controlling terminal and stdin is redirected to "/dev/null".
|
43
|
+
Unlike many common UNIX daemons, we do not chdir to "/"
|
44
|
+
upon daemonization to allow more control over the startup/upgrade
|
45
|
+
process.
|
46
|
+
Unless specified in the CONFIG_FILE, stderr and stdout will
|
47
|
+
also be redirected to "/dev/null".
|
48
|
+
.RS
|
49
|
+
.RE
|
50
|
+
.TP
|
51
|
+
.B \-E, \-\-env RACK_ENV
|
52
|
+
Run under the given RACK_ENV. See the RACK ENVIRONMENT section
|
53
|
+
for more details.
|
54
|
+
.RS
|
55
|
+
.RE
|
56
|
+
.TP
|
57
|
+
.B \-l, \-\-listen ADDRESS
|
58
|
+
Listens on a given ADDRESS. ADDRESS may be in the form of
|
59
|
+
HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
|
60
|
+
and PATH is meant to be a path to a UNIX domain socket.
|
61
|
+
Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080)
|
62
|
+
For production deployments, specifying the "listen" directive in
|
63
|
+
CONFIG_FILE is recommended as it allows fine\-tuning of socket
|
64
|
+
options.
|
65
|
+
.RS
|
66
|
+
.RE
|
67
|
+
.TP
|
68
|
+
.B \-N, \-\-no\-default\-middleware
|
69
|
+
Disables loading middleware implied by RACK_ENV. This bypasses the
|
70
|
+
configuration documented in the RACK ENVIRONMENT section, but still
|
71
|
+
allows RACK_ENV to be used for application/framework\-specific purposes.
|
72
|
+
.RS
|
73
|
+
.RE
|
74
|
+
.SH RACKUP COMPATIBILITY OPTIONS
|
75
|
+
.TP
|
76
|
+
.B \-o, \-\-host HOST
|
77
|
+
Listen on a TCP socket belonging to HOST, default is
|
78
|
+
"0.0.0.0" (all addresses).
|
79
|
+
If specified multiple times on the command\-line, only the
|
80
|
+
last\-specified value takes effect.
|
81
|
+
This option only exists for compatibility with the rackup(1) command,
|
82
|
+
use of "\-l"/"\-\-listen" switch is recommended instead.
|
83
|
+
.RS
|
84
|
+
.RE
|
85
|
+
.TP
|
86
|
+
.B \-p, \-\-port PORT
|
87
|
+
Listen on the specified TCP PORT, default is 8080.
|
88
|
+
If specified multiple times on the command\-line, only the last\-specified
|
89
|
+
value takes effect.
|
90
|
+
This option only exists for compatibility with the rackup(1) command,
|
91
|
+
use of "\-l"/"\-\-listen" switch is recommended instead.
|
92
|
+
.RS
|
93
|
+
.RE
|
94
|
+
.TP
|
95
|
+
.B \-s, \-\-server SERVER
|
96
|
+
No\-op, this exists only for compatibility with rackup(1).
|
97
|
+
.RS
|
98
|
+
.RE
|
99
|
+
.SH RUBY OPTIONS
|
100
|
+
.TP
|
101
|
+
.B \-e, \-\-eval LINE
|
102
|
+
Evaluate a LINE of Ruby code. This evaluation happens
|
103
|
+
immediately as the command\-line is being parsed.
|
104
|
+
.RS
|
105
|
+
.RE
|
106
|
+
.TP
|
107
|
+
.B \-d, \-\-debug
|
108
|
+
Turn on debug mode, the $DEBUG variable is set to true.
|
109
|
+
.RS
|
110
|
+
.RE
|
111
|
+
.TP
|
112
|
+
.B \-w, \-\-warn
|
113
|
+
Turn on verbose warnings, the $VERBOSE variable is set to true.
|
114
|
+
.RS
|
115
|
+
.RE
|
116
|
+
.TP
|
117
|
+
.B \-I, \-\-include PATH
|
118
|
+
specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
|
119
|
+
The \[aq]:\[aq] character may be used to delimit multiple directories.
|
120
|
+
This directive may be used more than once. Modifications to
|
121
|
+
$LOAD_PATH take place immediately and in the order they were
|
122
|
+
specified on the command\-line.
|
123
|
+
.RS
|
124
|
+
.RE
|
125
|
+
.TP
|
126
|
+
.B \-r, \-\-require LIBRARY
|
127
|
+
require a specified LIBRARY before executing the application. The
|
128
|
+
"require" statement will be executed immediately and in the order
|
129
|
+
they were specified on the command\-line.
|
130
|
+
.RS
|
131
|
+
.RE
|
132
|
+
.SH SIGNALS
|
133
|
+
.PP
|
134
|
+
The following UNIX signals may be sent to the master process:
|
135
|
+
.IP \[bu] 2
|
136
|
+
HUP \- reload config file, app, and gracefully restart all workers
|
137
|
+
.IP \[bu] 2
|
138
|
+
INT/TERM \- quick shutdown, kills all workers immediately
|
139
|
+
.IP \[bu] 2
|
140
|
+
QUIT \- graceful shutdown, waits for workers to finish their
|
141
|
+
current request before finishing.
|
142
|
+
.IP \[bu] 2
|
143
|
+
USR1 \- reopen all logs owned by the master and all workers
|
144
|
+
See Unicorn::Util.reopen_logs for what is considered a log.
|
145
|
+
.IP \[bu] 2
|
146
|
+
USR2 \- reexecute the running binary. A separate QUIT
|
147
|
+
should be sent to the original process once the child is verified to
|
148
|
+
be up and running.
|
149
|
+
.IP \[bu] 2
|
150
|
+
WINCH \- gracefully stops workers but keep the master running.
|
151
|
+
This will only work for daemonized processes.
|
152
|
+
.IP \[bu] 2
|
153
|
+
TTIN \- increment the number of worker processes by one
|
154
|
+
.IP \[bu] 2
|
155
|
+
TTOU \- decrement the number of worker processes by one
|
156
|
+
.PP
|
157
|
+
See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
|
158
|
+
full description of all signals used by Unicorn.
|
159
|
+
.SH RACK ENVIRONMENT
|
160
|
+
.PP
|
161
|
+
Accepted values of RACK_ENV and the middleware they automatically load
|
162
|
+
(outside of RACKUP_FILE) are exactly as those in rackup(1):
|
163
|
+
.IP \[bu] 2
|
164
|
+
development \- loads Rack::CommonLogger, Rack::ShowExceptions, and
|
165
|
+
Rack::Lint middleware
|
166
|
+
.IP \[bu] 2
|
167
|
+
deployment \- loads Rack::CommonLogger middleware
|
168
|
+
.IP \[bu] 2
|
169
|
+
none \- loads no middleware at all, relying entirely on RACKUP_FILE
|
170
|
+
.PP
|
171
|
+
All unrecognized values for RACK_ENV are assumed to be
|
172
|
+
"none". Production deployments are strongly encouraged to use
|
173
|
+
"deployment" or "none" for maximum performance.
|
174
|
+
.PP
|
175
|
+
As of Unicorn 0.94.0, RACK_ENV is exported as a process\-wide environment
|
176
|
+
variable as well. While not current a part of the Rack specification as
|
177
|
+
of Rack 1.0.1, this has become a de facto standard in the Rack world.
|
178
|
+
.PP
|
179
|
+
Note the Rack::ContentLength and Rack::Chunked middlewares are also
|
180
|
+
loaded by "deployment" and "development", but no other values of
|
181
|
+
RACK_ENV. If needed, they must be individually specified in the
|
182
|
+
RACKUP_FILE, some frameworks do not require them.
|
183
|
+
.SH ENVIRONMENT VARIABLES
|
184
|
+
.PP
|
185
|
+
The RACK_ENV variable is set by the aforementioned \-E switch.
|
186
|
+
All application or library\-specific environment variables (e.g. TMPDIR)
|
187
|
+
may always be set in the Unicorn CONFIG_FILE in addition to the spawning
|
188
|
+
shell. When transparently upgrading Unicorn, all environment variables
|
189
|
+
set in the old master process are inherited by the new master process.
|
190
|
+
Unicorn only uses (and will overwrite) the UNICORN_FD environment
|
191
|
+
variable internally when doing transparent upgrades.
|
192
|
+
.PP
|
193
|
+
UNICORN_FD is a comma\-delimited list of one or more file descriptors
|
194
|
+
used to implement USR2 upgrades. Init systems may bind listen sockets
|
195
|
+
itself and spawn unicorn with UNICORN_FD set to the file descriptor
|
196
|
+
numbers of the listen socket(s).
|
197
|
+
.PP
|
198
|
+
As of unicorn 5.0, LISTEN_PID and LISTEN_FDS are used for socket
|
199
|
+
activation as documented in the sd_listen_fds(3) manpage. Users
|
200
|
+
relying on this feature do not need to specify a listen socket in
|
201
|
+
the unicorn config file.
|
202
|
+
.SH SEE ALSO
|
203
|
+
.IP \[bu] 2
|
204
|
+
\f[I]Rack::Builder\f[] ri/RDoc
|
205
|
+
.IP \[bu] 2
|
206
|
+
\f[I]Unicorn::Configurator\f[] ri/RDoc
|
207
|
+
.UR https://yhbt.net/unicorn/Unicorn/Configurator.html
|
208
|
+
.UE
|
209
|
+
.IP \[bu] 2
|
210
|
+
unicorn RDoc
|
211
|
+
.UR https://yhbt.net/unicorn/
|
212
|
+
.UE
|
213
|
+
.IP \[bu] 2
|
214
|
+
Rack RDoc
|
215
|
+
.UR https://www.rubydoc.info/github/rack/rack/
|
216
|
+
.UE
|
217
|
+
.IP \[bu] 2
|
218
|
+
Rackup HowTo
|
219
|
+
.UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
|
220
|
+
.UE
|
221
|
+
.SH AUTHORS
|
222
|
+
The Unicorn Community <unicorn-public@yhbt.net>.
|
@@ -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>.
|
data/FAQ
CHANGED
@@ -7,7 +7,7 @@ drained entirely by the application. This may happen when request
|
|
7
7
|
bodies are gzipped, as unicorn reads request body data lazily to avoid
|
8
8
|
overhead from bad requests.
|
9
9
|
|
10
|
-
Ref:
|
10
|
+
Ref: https://yhbt.net/unicorn-public/FC91211E-FD32-432C-92FC-0318714C2170@zendesk.com/
|
11
11
|
|
12
12
|
=== Why aren't my Rails log files rotated when I use SIGUSR1?
|
13
13
|
|
data/GIT-VERSION-FILE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
GIT_VERSION =
|
1
|
+
GIT_VERSION = 6.1.0
|
data/GIT-VERSION-GEN
CHANGED