unicorn 5.4.1 → 5.7.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 +4 -4
- data/.manifest +7 -3
- data/.olddoc.yml +12 -7
- data/Application_Timeouts +4 -4
- 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 +111 -57
- data/HACKING +1 -1
- data/ISSUES +21 -23
- data/KNOWN_ISSUES +2 -2
- data/LATEST +22 -28
- data/LICENSE +2 -2
- data/Links +13 -11
- data/NEWS +65 -0
- data/README +25 -11
- data/SIGNALS +1 -1
- data/Sandbox +4 -4
- 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/logrotate.conf +3 -3
- 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 +7 -0
- data/ext/unicorn_http/common_field_optimization.h +24 -6
- data/ext/unicorn_http/extconf.rb +35 -0
- data/ext/unicorn_http/global_variables.h +2 -2
- data/ext/unicorn_http/httpdate.c +2 -2
- data/ext/unicorn_http/unicorn_http.c +257 -224
- data/ext/unicorn_http/unicorn_http.rl +47 -14
- data/lib/unicorn/configurator.rb +25 -4
- data/lib/unicorn/http_request.rb +12 -2
- data/lib/unicorn/http_server.rb +38 -11
- data/lib/unicorn/launcher.rb +1 -1
- data/lib/unicorn/oob_gc.rb +2 -2
- data/lib/unicorn/socket_helper.rb +1 -0
- data/lib/unicorn/tmpio.rb +8 -2
- data/lib/unicorn/util.rb +1 -1
- data/lib/unicorn/version.rb +1 -1
- data/lib/unicorn/worker.rb +16 -2
- data/lib/unicorn.rb +23 -9
- data/man/man1/unicorn.1 +89 -88
- data/man/man1/unicorn_rails.1 +78 -83
- data/t/GNUmakefile +3 -72
- data/t/README +4 -4
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- 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 +9 -7
- data/test/test_helper.rb +22 -30
- data/test/unit/test_http_parser.rb +16 -0
- data/test/unit/test_http_parser_ng.rb +81 -0
- data/test/unit/test_server.rb +30 -0
- data/test/unit/test_upload.rb +4 -9
- data/test/unit/test_util.rb +25 -0
- data/unicorn.gemspec +8 -7
- metadata +15 -11
- data/Documentation/GNUmakefile +0 -30
- data/Documentation/unicorn.1.txt +0 -187
- data/Documentation/unicorn_rails.1.txt +0 -175
data/man/man1/unicorn.1
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
.\" Automatically generated by Pandoc 1.17.2
|
2
|
-
.\"
|
3
1
|
.TH "UNICORN" "1" "September 15, 2009" "Unicorn User Manual" ""
|
4
2
|
.hy
|
5
3
|
.SH NAME
|
@@ -11,73 +9,73 @@ unicorn [\-c CONFIG_FILE] [\-E RACK_ENV] [\-D] [RACKUP_FILE]
|
|
11
9
|
.SH DESCRIPTION
|
12
10
|
.PP
|
13
11
|
A rackup(1)\-like command to launch Rack applications using Unicorn.
|
14
|
-
It is expected to be started in your application root (APP_ROOT),
|
15
|
-
the "working_directory" directive may be used in the CONFIG_FILE.
|
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.
|
16
14
|
.PP
|
17
|
-
While unicorn takes a myriad of command\-line options for
|
18
|
-
with ruby(1) and rackup(1), it is recommended to stick
|
19
|
-
command\-line options specified in the SYNOPSIS and use
|
20
|
-
as much as possible.
|
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.
|
21
19
|
.SH RACKUP FILE
|
22
20
|
.PP
|
23
|
-
This defaults to "config.ru" in APP_ROOT.
|
24
|
-
|
25
|
-
|
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.
|
26
24
|
.PP
|
27
|
-
Embedded command\-line options are mostly parsed for compatibility
|
28
|
-
rackup(1) but strongly discouraged.
|
25
|
+
Embedded command\-line options are mostly parsed for compatibility
|
26
|
+
with rackup(1) but strongly discouraged.
|
29
27
|
.SH UNICORN OPTIONS
|
30
28
|
.TP
|
31
29
|
.B \-c, \-\-config\-file CONFIG_FILE
|
32
|
-
Path to the Unicorn\-specific config file.
|
33
|
-
|
34
|
-
See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the
|
35
|
-
|
36
|
-
Using an absolute path for for CONFIG_FILE is recommended as it
|
37
|
-
multiple instances of Unicorn easily distinguishable when
|
38
|
-
output.
|
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.
|
39
37
|
.RS
|
40
38
|
.RE
|
41
39
|
.TP
|
42
40
|
.B \-D, \-\-daemonize
|
43
|
-
Run daemonized in the background.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
Unless specified in the CONFIG_FILE, stderr and stdout will
|
49
|
-
redirected to "/dev/null".
|
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".
|
50
48
|
.RS
|
51
49
|
.RE
|
52
50
|
.TP
|
53
51
|
.B \-E, \-\-env RACK_ENV
|
54
|
-
Run under the given RACK_ENV.
|
55
|
-
|
52
|
+
Run under the given RACK_ENV. See the RACK ENVIRONMENT section
|
53
|
+
for more details.
|
56
54
|
.RS
|
57
55
|
.RE
|
58
56
|
.TP
|
59
57
|
.B \-l, \-\-listen ADDRESS
|
60
|
-
Listens on a given ADDRESS.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
\-N, \-\-no\-default\-middleware
|
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.
|
68
65
|
.RS
|
69
66
|
.RE
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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.
|
74
72
|
.RS
|
75
73
|
.RE
|
76
74
|
.SH RACKUP COMPATIBILITY OPTIONS
|
77
75
|
.TP
|
78
76
|
.B \-o, \-\-host HOST
|
79
|
-
Listen on a TCP socket belonging to HOST, default is
|
80
|
-
addresses).
|
77
|
+
Listen on a TCP socket belonging to HOST, default is
|
78
|
+
"0.0.0.0" (all addresses).
|
81
79
|
If specified multiple times on the command\-line, only the
|
82
80
|
last\-specified value takes effect.
|
83
81
|
This option only exists for compatibility with the rackup(1) command,
|
@@ -87,8 +85,8 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
|
|
87
85
|
.TP
|
88
86
|
.B \-p, \-\-port PORT
|
89
87
|
Listen on the specified TCP PORT, default is 8080.
|
90
|
-
If specified multiple times on the command\-line, only the
|
91
|
-
|
88
|
+
If specified multiple times on the command\-line, only the last\-specified
|
89
|
+
value takes effect.
|
92
90
|
This option only exists for compatibility with the rackup(1) command,
|
93
91
|
use of "\-l"/"\-\-listen" switch is recommended instead.
|
94
92
|
.RS
|
@@ -101,9 +99,8 @@ No\-op, this exists only for compatibility with rackup(1).
|
|
101
99
|
.SH RUBY OPTIONS
|
102
100
|
.TP
|
103
101
|
.B \-e, \-\-eval LINE
|
104
|
-
Evaluate a LINE of Ruby code.
|
105
|
-
|
106
|
-
parsed.
|
102
|
+
Evaluate a LINE of Ruby code. This evaluation happens
|
103
|
+
immediately as the command\-line is being parsed.
|
107
104
|
.RS
|
108
105
|
.RE
|
109
106
|
.TP
|
@@ -118,18 +115,17 @@ Turn on verbose warnings, the $VERBOSE variable is set to true.
|
|
118
115
|
.RE
|
119
116
|
.TP
|
120
117
|
.B \-I, \-\-include PATH
|
121
|
-
specify $LOAD_PATH.
|
122
|
-
PATH will be prepended to $LOAD_PATH.
|
118
|
+
specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
|
123
119
|
The \[aq]:\[aq] character may be used to delimit multiple directories.
|
124
|
-
This directive may be used more than once.
|
125
|
-
|
126
|
-
|
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.
|
127
123
|
.RS
|
128
124
|
.RE
|
129
125
|
.TP
|
130
126
|
.B \-r, \-\-require LIBRARY
|
131
|
-
require a specified LIBRARY before executing the application.
|
132
|
-
|
127
|
+
require a specified LIBRARY before executing the application. The
|
128
|
+
"require" statement will be executed immediately and in the order
|
133
129
|
they were specified on the command\-line.
|
134
130
|
.RS
|
135
131
|
.RE
|
@@ -141,15 +137,15 @@ HUP \- reload config file, app, and gracefully restart all workers
|
|
141
137
|
.IP \[bu] 2
|
142
138
|
INT/TERM \- quick shutdown, kills all workers immediately
|
143
139
|
.IP \[bu] 2
|
144
|
-
QUIT \- graceful shutdown, waits for workers to finish their
|
145
|
-
request before finishing.
|
140
|
+
QUIT \- graceful shutdown, waits for workers to finish their
|
141
|
+
current request before finishing.
|
146
142
|
.IP \[bu] 2
|
147
|
-
USR1 \- reopen all logs owned by the master and all workers
|
148
|
-
Unicorn::Util.reopen_logs for what is considered a log.
|
143
|
+
USR1 \- reopen all logs owned by the master and all workers
|
144
|
+
See Unicorn::Util.reopen_logs for what is considered a log.
|
149
145
|
.IP \[bu] 2
|
150
|
-
USR2 \- reexecute the running binary.
|
151
|
-
|
152
|
-
|
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.
|
153
149
|
.IP \[bu] 2
|
154
150
|
WINCH \- gracefully stops workers but keep the master running.
|
155
151
|
This will only work for daemonized processes.
|
@@ -158,7 +154,7 @@ TTIN \- increment the number of worker processes by one
|
|
158
154
|
.IP \[bu] 2
|
159
155
|
TTOU \- decrement the number of worker processes by one
|
160
156
|
.PP
|
161
|
-
See the SIGNALS (https://
|
157
|
+
See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
|
162
158
|
full description of all signals used by Unicorn.
|
163
159
|
.SH RACK ENVIRONMENT
|
164
160
|
.PP
|
@@ -166,56 +162,61 @@ Accepted values of RACK_ENV and the middleware they automatically load
|
|
166
162
|
(outside of RACKUP_FILE) are exactly as those in rackup(1):
|
167
163
|
.IP \[bu] 2
|
168
164
|
development \- loads Rack::CommonLogger, Rack::ShowExceptions, and
|
169
|
-
Rack::Lint middleware
|
165
|
+
Rack::Lint middleware
|
170
166
|
.IP \[bu] 2
|
171
167
|
deployment \- loads Rack::CommonLogger middleware
|
172
168
|
.IP \[bu] 2
|
173
169
|
none \- loads no middleware at all, relying entirely on RACKUP_FILE
|
174
170
|
.PP
|
175
|
-
All unrecognized values for RACK_ENV are assumed to be
|
176
|
-
Production deployments are strongly encouraged to use
|
177
|
-
"none" for maximum performance.
|
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.
|
178
174
|
.PP
|
179
|
-
As of Unicorn 0.94.0, RACK_ENV is exported as a process\-wide
|
180
|
-
|
181
|
-
|
182
|
-
this has become a de facto standard in the Rack world.
|
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.
|
183
178
|
.PP
|
184
179
|
Note the Rack::ContentLength and Rack::Chunked middlewares are also
|
185
180
|
loaded by "deployment" and "development", but no other values of
|
186
|
-
RACK_ENV.
|
187
|
-
|
188
|
-
frameworks do not require them.
|
181
|
+
RACK_ENV. If needed, they must be individually specified in the
|
182
|
+
RACKUP_FILE, some frameworks do not require them.
|
189
183
|
.SH ENVIRONMENT VARIABLES
|
190
184
|
.PP
|
191
185
|
The RACK_ENV variable is set by the aforementioned \-E switch.
|
192
|
-
All application or library\-specific environment variables (e.g.
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
the old master process are inherited by the new master process.
|
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.
|
197
190
|
Unicorn only uses (and will overwrite) the UNICORN_FD environment
|
198
191
|
variable internally when doing transparent upgrades.
|
199
192
|
.PP
|
200
193
|
UNICORN_FD is a comma\-delimited list of one or more file descriptors
|
201
|
-
used to implement USR2 upgrades.
|
202
|
-
|
203
|
-
|
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).
|
204
197
|
.PP
|
205
198
|
As of unicorn 5.0, LISTEN_PID and LISTEN_FDS are used for socket
|
206
|
-
activation as documented in the sd_listen_fds(3) manpage.
|
207
|
-
|
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
|
208
201
|
the unicorn config file.
|
209
202
|
.SH SEE ALSO
|
210
203
|
.IP \[bu] 2
|
211
204
|
\f[I]Rack::Builder\f[] ri/RDoc
|
212
205
|
.IP \[bu] 2
|
213
206
|
\f[I]Unicorn::Configurator\f[] ri/RDoc
|
207
|
+
.UR https://yhbt.net/unicorn/Unicorn/Configurator.html
|
208
|
+
.UE
|
214
209
|
.IP \[bu] 2
|
215
|
-
|
210
|
+
unicorn RDoc
|
211
|
+
.UR https://yhbt.net/unicorn/
|
212
|
+
.UE
|
216
213
|
.IP \[bu] 2
|
217
|
-
Rack RDoc
|
214
|
+
Rack RDoc
|
215
|
+
.UR https://www.rubydoc.info/github/rack/rack/
|
216
|
+
.UE
|
218
217
|
.IP \[bu] 2
|
219
|
-
Rackup HowTo
|
218
|
+
Rackup HowTo
|
219
|
+
.UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
|
220
|
+
.UE
|
220
221
|
.SH AUTHORS
|
221
|
-
The Unicorn Community <unicorn-public@
|
222
|
+
The Unicorn Community <unicorn-public@yhbt.net>.
|
data/man/man1/unicorn_rails.1
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
.\" Automatically generated by Pandoc 1.17.2
|
2
|
-
.\"
|
3
1
|
.TH "UNICORN_RAILS" "1" "September 17, 2009" "Unicorn User Manual" ""
|
4
2
|
.hy
|
5
3
|
.SH NAME
|
@@ -10,17 +8,12 @@ unicorn_rails \- unicorn launcher for Rails 1.x and 2.x users
|
|
10
8
|
unicorn_rails [\-c CONFIG_FILE] [\-E RAILS_ENV] [\-D] [RACKUP_FILE]
|
11
9
|
.SH DESCRIPTION
|
12
10
|
.PP
|
13
|
-
A rackup(1)\-like command to launch Rails
|
14
|
-
|
15
|
-
|
16
|
-
CONFIG_FILE.
|
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).
|
17
14
|
.PP
|
18
|
-
It is
|
19
|
-
|
20
|
-
Rails 3 users are encouraged to use unicorn(1) instead of
|
21
|
-
unicorn_rails(1).
|
22
|
-
Users of Rails 1.x/2.y may also use unicorn(1) instead of
|
23
|
-
unicorn_rails(1).
|
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.
|
24
17
|
.PP
|
25
18
|
The outward interface resembles rackup(1), the internals and default
|
26
19
|
middleware loading is designed like the \f[C]script/server\f[] command
|
@@ -33,56 +26,55 @@ as much as possible.
|
|
33
26
|
.SH UNICORN OPTIONS
|
34
27
|
.TP
|
35
28
|
.B \-c, \-\-config\-file CONFIG_FILE
|
36
|
-
Path to the Unicorn\-specific config file.
|
37
|
-
|
38
|
-
See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the
|
39
|
-
|
40
|
-
Using an absolute path for for CONFIG_FILE is recommended as it
|
41
|
-
multiple instances of Unicorn easily distinguishable when
|
42
|
-
output.
|
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.
|
43
36
|
.RS
|
44
37
|
.RE
|
45
38
|
.TP
|
46
39
|
.B \-D, \-\-daemonize
|
47
|
-
Run daemonized in the background.
|
48
|
-
|
49
|
-
redirected to "/dev/null".
|
40
|
+
Run daemonized in the background. The process is detached from
|
41
|
+
the controlling terminal and stdin is redirected to "/dev/null".
|
50
42
|
Unlike many common UNIX daemons, we do not chdir to "/" upon
|
51
|
-
daemonization to allow more control over the startup/upgrade
|
52
|
-
|
53
|
-
|
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".
|
54
47
|
Daemonization will \f[I]skip\f[] loading of the
|
55
|
-
\f[I]Rails::Rack::LogTailer\f[]
|
48
|
+
\f[I]Rails::Rack::LogTailer\f[]
|
49
|
+
middleware under Rails >= 2.3.x.
|
56
50
|
By default, unicorn_rails(1) will create a PID file in
|
57
|
-
\f[I]"RAILS_ROOT/tmp/pids/unicorn.pid"\f[].
|
58
|
-
|
59
|
-
Unicorn config file.
|
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.
|
60
53
|
.RS
|
61
54
|
.RE
|
62
55
|
.TP
|
63
56
|
.B \-E, \-\-env RAILS_ENV
|
64
|
-
Run under the given RAILS_ENV.
|
65
|
-
|
66
|
-
Acceptable values are exactly those you expect in your Rails
|
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
|
67
59
|
application, typically "development" or "production".
|
68
60
|
.RS
|
69
61
|
.RE
|
70
62
|
.TP
|
71
63
|
.B \-l, \-\-listen ADDRESS
|
72
|
-
Listens on a given ADDRESS.
|
73
|
-
|
74
|
-
|
75
|
-
socket.
|
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.
|
76
67
|
Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080).
|
77
68
|
For production deployments, specifying the "listen" directive in
|
78
|
-
CONFIG_FILE is recommended as it allows fine\-tuning of socket
|
69
|
+
CONFIG_FILE is recommended as it allows fine\-tuning of socket
|
70
|
+
options.
|
79
71
|
.RS
|
80
72
|
.RE
|
81
73
|
.SH RACKUP COMPATIBILITY OPTIONS
|
82
74
|
.TP
|
83
75
|
.B \-o, \-\-host HOST
|
84
|
-
Listen on a TCP socket belonging to HOST, default is
|
85
|
-
addresses).
|
76
|
+
Listen on a TCP socket belonging to HOST, default is
|
77
|
+
"0.0.0.0" (all addresses).
|
86
78
|
If specified multiple times on the command\-line, only the
|
87
79
|
last\-specified value takes effect.
|
88
80
|
This option only exists for compatibility with the rackup(1) command,
|
@@ -92,8 +84,8 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
|
|
92
84
|
.TP
|
93
85
|
.B \-p, \-\-port PORT
|
94
86
|
Listen on the specified TCP PORT, default is 8080.
|
95
|
-
If specified multiple times on the command\-line, only the
|
96
|
-
|
87
|
+
If specified multiple times on the command\-line, only the last\-specified
|
88
|
+
value takes effect.
|
97
89
|
This option only exists for compatibility with the rackup(1) command,
|
98
90
|
use of "\-l"/"\-\-listen" switch is recommended instead.
|
99
91
|
.RS
|
@@ -101,17 +93,16 @@ use of "\-l"/"\-\-listen" switch is recommended instead.
|
|
101
93
|
.TP
|
102
94
|
.B \-\-path PATH
|
103
95
|
Mounts the Rails application at the given PATH (instead of "/").
|
104
|
-
This is equivalent to setting the RAILS_RELATIVE_URL_ROOT
|
105
|
-
variable.
|
106
|
-
|
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.
|
107
99
|
.RS
|
108
100
|
.RE
|
109
101
|
.SH RUBY OPTIONS
|
110
102
|
.TP
|
111
103
|
.B \-e, \-\-eval LINE
|
112
|
-
Evaluate a LINE of Ruby code.
|
113
|
-
|
114
|
-
parsed.
|
104
|
+
Evaluate a LINE of Ruby code. This evaluation happens
|
105
|
+
immediately as the command\-line is being parsed.
|
115
106
|
.RS
|
116
107
|
.RE
|
117
108
|
.TP
|
@@ -128,46 +119,42 @@ Turn on verbose warnings, the $VERBOSE variable is set to true.
|
|
128
119
|
.RE
|
129
120
|
.TP
|
130
121
|
.B \-I, \-\-include PATH
|
131
|
-
specify $LOAD_PATH.
|
132
|
-
PATH will be prepended to $LOAD_PATH.
|
122
|
+
specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
|
133
123
|
The \[aq]:\[aq] character may be used to delimit multiple directories.
|
134
|
-
This directive may be used more than once.
|
135
|
-
|
136
|
-
|
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.
|
137
127
|
.RS
|
138
128
|
.RE
|
139
129
|
.TP
|
140
130
|
.B \-r, \-\-require LIBRARY
|
141
|
-
require a specified LIBRARY before executing the application.
|
142
|
-
|
131
|
+
require a specified LIBRARY before executing the application. The
|
132
|
+
"require" statement will be executed immediately and in the order
|
143
133
|
they were specified on the command\-line.
|
144
134
|
.RS
|
145
135
|
.RE
|
146
136
|
.SH RACKUP FILE
|
147
137
|
.PP
|
148
|
-
This defaults to "config.ru" in RAILS_ROOT.
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
default middleware for performance.
|
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.
|
154
143
|
.PP
|
155
|
-
Embedded command\-line options are mostly parsed for compatibility
|
156
|
-
rackup(1) but strongly discouraged.
|
144
|
+
Embedded command\-line options are mostly parsed for compatibility
|
145
|
+
with rackup(1) but strongly discouraged.
|
157
146
|
.SH ENVIRONMENT VARIABLES
|
158
147
|
.PP
|
159
|
-
The RAILS_ENV variable is set by the aforementioned \-E switch.
|
160
|
-
|
161
|
-
switch.
|
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.
|
162
150
|
Either of these variables may also be set in the shell or the Unicorn
|
163
|
-
CONFIG_FILE.
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
variable internally when doing transparent upgrades.
|
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.
|
171
158
|
.SH SIGNALS
|
172
159
|
.PP
|
173
160
|
The following UNIX signals may be sent to the master process:
|
@@ -179,12 +166,12 @@ INT/TERM \- quick shutdown, kills all workers immediately
|
|
179
166
|
QUIT \- graceful shutdown, waits for workers to finish their current
|
180
167
|
request before finishing.
|
181
168
|
.IP \[bu] 2
|
182
|
-
USR1 \- reopen all logs owned by the master and all workers
|
183
|
-
Unicorn::Util.reopen_logs for what is considered a log.
|
169
|
+
USR1 \- reopen all logs owned by the master and all workers
|
170
|
+
See Unicorn::Util.reopen_logs for what is considered a log.
|
184
171
|
.IP \[bu] 2
|
185
|
-
USR2 \- reexecute the running binary.
|
186
|
-
|
187
|
-
|
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.
|
188
175
|
.IP \[bu] 2
|
189
176
|
WINCH \- gracefully stops workers but keep the master running.
|
190
177
|
This will only work for daemonized processes.
|
@@ -193,7 +180,7 @@ TTIN \- increment the number of worker processes by one
|
|
193
180
|
.IP \[bu] 2
|
194
181
|
TTOU \- decrement the number of worker processes by one
|
195
182
|
.PP
|
196
|
-
See the SIGNALS (https://
|
183
|
+
See the SIGNALS (https://yhbt.net/unicorn/SIGNALS.html) document for
|
197
184
|
full description of all signals used by Unicorn.
|
198
185
|
.SH SEE ALSO
|
199
186
|
.IP \[bu] 2
|
@@ -202,11 +189,19 @@ unicorn(1)
|
|
202
189
|
\f[I]Rack::Builder\f[] ri/RDoc
|
203
190
|
.IP \[bu] 2
|
204
191
|
\f[I]Unicorn::Configurator\f[] ri/RDoc
|
192
|
+
.UR https://yhbt.net/unicorn/Unicorn/Configurator.html
|
193
|
+
.UE
|
205
194
|
.IP \[bu] 2
|
206
|
-
|
195
|
+
unicorn RDoc
|
196
|
+
.UR https://yhbt.net/unicorn/
|
197
|
+
.UE
|
207
198
|
.IP \[bu] 2
|
208
|
-
Rack RDoc
|
199
|
+
Rack RDoc
|
200
|
+
.UR https://www.rubydoc.info/github/rack/rack/
|
201
|
+
.UE
|
209
202
|
.IP \[bu] 2
|
210
|
-
Rackup HowTo
|
203
|
+
Rackup HowTo
|
204
|
+
.UR https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
|
205
|
+
.UE
|
211
206
|
.SH AUTHORS
|
212
|
-
The Unicorn Community <unicorn-public@
|
207
|
+
The Unicorn Community <unicorn-public@yhbt.net>.
|
data/t/GNUmakefile
CHANGED
@@ -1,74 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# there used to be more, here, but we stopped relying on recursive make
|
2
2
|
all::
|
3
|
+
$(MAKE) -C .. test-integration
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
RUBY = ruby
|
7
|
-
RAKE = rake
|
8
|
-
-include ../local.mk
|
9
|
-
ifeq ($(RUBY_VERSION),)
|
10
|
-
RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
|
11
|
-
endif
|
12
|
-
|
13
|
-
ifeq ($(RUBY_VERSION),)
|
14
|
-
$(error unable to detect RUBY_VERSION)
|
15
|
-
endif
|
16
|
-
|
17
|
-
RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))')
|
18
|
-
export RUBY_ENGINE
|
19
|
-
|
20
|
-
MYLIBS := $(RUBYLIB)
|
21
|
-
|
22
|
-
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
|
23
|
-
|
24
|
-
all:: $(T)
|
25
|
-
|
26
|
-
# can't rely on "set -o pipefail" since we don't require bash or ksh93 :<
|
27
|
-
t_pfx = trash/$@-$(RUBY_ENGINE)-$(RUBY_VERSION)
|
28
|
-
TEST_OPTS =
|
29
|
-
# TRACER = strace -f -o $(t_pfx).strace -s 100000
|
30
|
-
# TRACER = /usr/bin/time -o $(t_pfx).time
|
31
|
-
|
32
|
-
ifdef V
|
33
|
-
ifeq ($(V),2)
|
34
|
-
TEST_OPTS += --trace
|
35
|
-
else
|
36
|
-
TEST_OPTS += --verbose
|
37
|
-
endif
|
38
|
-
endif
|
39
|
-
|
40
|
-
random_blob:
|
41
|
-
dd if=/dev/urandom bs=1M count=30 of=$@.$(pid)
|
42
|
-
mv $@.$(pid) $@
|
43
|
-
|
44
|
-
$(T): random_blob
|
45
|
-
|
46
|
-
dependencies := socat curl
|
47
|
-
deps := $(addprefix .dep+,$(dependencies))
|
48
|
-
$(deps): dep_bin = $(lastword $(subst +, ,$@))
|
49
|
-
$(deps):
|
50
|
-
@which $(dep_bin) > $@.$(pid) 2>/dev/null || :
|
51
|
-
@test -s $@.$(pid) || \
|
52
|
-
{ echo >&2 "E '$(dep_bin)' not found in PATH=$(PATH)"; exit 1; }
|
53
|
-
@mv $@.$(pid) $@
|
54
|
-
dep: $(deps)
|
55
|
-
|
56
|
-
test_prefix := $(CURDIR)/../test/$(RUBY_ENGINE)-$(RUBY_VERSION)
|
57
|
-
$(test_prefix)/.stamp:
|
58
|
-
$(MAKE) -C .. test-install
|
59
|
-
|
60
|
-
$(T): export RUBY := $(RUBY)
|
61
|
-
$(T): export RAKE := $(RAKE)
|
62
|
-
$(T): export PATH := $(test_prefix)/bin:$(PATH)
|
63
|
-
$(T): export RUBYLIB := $(test_prefix)/lib:$(MYLIBS)
|
64
|
-
$(T): dep $(test_prefix)/.stamp trash/.gitignore
|
65
|
-
$(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS)
|
66
|
-
|
67
|
-
trash/.gitignore:
|
68
|
-
mkdir -p $(@D)
|
69
|
-
echo '*' > $@
|
70
|
-
|
71
|
-
clean:
|
72
|
-
$(RM) -r trash/*
|
73
|
-
|
74
|
-
.PHONY: $(T) clean
|
5
|
+
.PHONY: all
|
data/t/README
CHANGED
@@ -10,17 +10,17 @@ comfortable writing integration tests with.
|
|
10
10
|
|
11
11
|
== Requirements
|
12
12
|
|
13
|
-
* {Ruby 1.9.3+}[https://www.ruby-lang.org/] (duh!)
|
14
|
-
* {GNU make}[
|
13
|
+
* {Ruby 1.9.3+}[https://www.ruby-lang.org/en/] (duh!)
|
14
|
+
* {GNU make}[https://www.gnu.org/software/make/]
|
15
15
|
* {socat}[http://www.dest-unreach.org/socat/]
|
16
|
-
* {curl}[
|
16
|
+
* {curl}[https://curl.haxx.se/]
|
17
17
|
* standard UNIX shell utilities (Bourne sh, awk, sed, grep, ...)
|
18
18
|
|
19
19
|
We do not use bashisms or any non-portable, non-POSIX constructs
|
20
20
|
in our shell code. We use the "pipefail" option if available and
|
21
21
|
mainly test with {ksh}[http://kornshell.com/], but occasionally
|
22
22
|
with {dash}[http://gondor.apana.org.au/~herbert/dash/] and
|
23
|
-
{bash}[
|
23
|
+
{bash}[https://www.gnu.org/software/bash/], too.
|
24
24
|
|
25
25
|
== Running Tests
|
26
26
|
|