unicorn 4.8.3 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/.document +0 -1
  3. data/.gitattributes +5 -0
  4. data/.gitignore +2 -2
  5. data/.manifest +15 -19
  6. data/.olddoc.yml +25 -0
  7. data/Application_Timeouts +7 -7
  8. data/CONTRIBUTORS +6 -2
  9. data/DESIGN +2 -4
  10. data/Documentation/.gitignore +1 -3
  11. data/Documentation/unicorn.1 +222 -0
  12. data/Documentation/unicorn_rails.1 +207 -0
  13. data/FAQ +23 -6
  14. data/GIT-VERSION-FILE +1 -1
  15. data/GIT-VERSION-GEN +1 -1
  16. data/GNUmakefile +138 -92
  17. data/HACKING +5 -30
  18. data/ISSUES +73 -36
  19. data/KNOWN_ISSUES +18 -18
  20. data/LATEST +16 -22
  21. data/LICENSE +2 -2
  22. data/Links +24 -22
  23. data/NEWS +771 -0
  24. data/PHILOSOPHY +0 -6
  25. data/README +48 -42
  26. data/Rakefile +0 -44
  27. data/SIGNALS +2 -2
  28. data/Sandbox +11 -10
  29. data/TODO +0 -2
  30. data/TUNING +30 -9
  31. data/archive/slrnpull.conf +1 -1
  32. data/bin/unicorn +4 -2
  33. data/bin/unicorn_rails +3 -3
  34. data/examples/big_app_gc.rb +1 -1
  35. data/examples/init.sh +36 -8
  36. data/examples/logrotate.conf +17 -2
  37. data/examples/nginx.conf +14 -14
  38. data/examples/unicorn.conf.minimal.rb +2 -2
  39. data/examples/unicorn.conf.rb +14 -6
  40. data/examples/unicorn.socket +11 -0
  41. data/examples/unicorn@.service +40 -0
  42. data/ext/unicorn_http/c_util.h +5 -13
  43. data/ext/unicorn_http/common_field_optimization.h +22 -5
  44. data/ext/unicorn_http/epollexclusive.h +124 -0
  45. data/ext/unicorn_http/ext_help.h +0 -44
  46. data/ext/unicorn_http/extconf.rb +32 -5
  47. data/ext/unicorn_http/global_variables.h +2 -2
  48. data/ext/unicorn_http/httpdate.c +3 -2
  49. data/ext/unicorn_http/unicorn_http.c +926 -638
  50. data/ext/unicorn_http/unicorn_http.rl +159 -170
  51. data/ext/unicorn_http/unicorn_http_common.rl +1 -1
  52. data/lib/unicorn/configurator.rb +110 -46
  53. data/lib/unicorn/const.rb +2 -25
  54. data/lib/unicorn/http_request.rb +110 -31
  55. data/lib/unicorn/http_response.rb +17 -31
  56. data/lib/unicorn/http_server.rb +259 -179
  57. data/lib/unicorn/launcher.rb +1 -1
  58. data/lib/unicorn/oob_gc.rb +6 -6
  59. data/lib/unicorn/select_waiter.rb +6 -0
  60. data/lib/unicorn/socket_helper.rb +58 -78
  61. data/lib/unicorn/stream_input.rb +8 -7
  62. data/lib/unicorn/tee_input.rb +16 -11
  63. data/lib/unicorn/tmpio.rb +10 -6
  64. data/lib/unicorn/util.rb +5 -4
  65. data/lib/unicorn/version.rb +1 -1
  66. data/lib/unicorn/worker.rb +36 -23
  67. data/lib/unicorn.rb +64 -44
  68. data/man/man1/unicorn.1 +124 -112
  69. data/man/man1/unicorn_rails.1 +106 -107
  70. data/t/GNUmakefile +3 -76
  71. data/t/README +4 -4
  72. data/t/t0002-parser-error.sh +3 -3
  73. data/t/t0011-active-unix-socket.sh +1 -1
  74. data/t/t0012-reload-empty-config.sh +2 -1
  75. data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
  76. data/t/t0301.ru +13 -0
  77. data/t/test-lib.sh +4 -3
  78. data/test/benchmark/README +14 -4
  79. data/test/benchmark/ddstream.ru +50 -0
  80. data/test/benchmark/readinput.ru +40 -0
  81. data/test/benchmark/uconnect.perl +66 -0
  82. data/test/exec/test_exec.rb +74 -20
  83. data/test/test_helper.rb +42 -33
  84. data/test/unit/test_ccc.rb +91 -0
  85. data/test/unit/test_droplet.rb +1 -1
  86. data/test/unit/test_http_parser.rb +49 -19
  87. data/test/unit/test_http_parser_ng.rb +98 -115
  88. data/test/unit/test_request.rb +11 -11
  89. data/test/unit/test_response.rb +31 -19
  90. data/test/unit/test_server.rb +89 -15
  91. data/test/unit/test_signals.rb +9 -9
  92. data/test/unit/test_socket_helper.rb +16 -12
  93. data/test/unit/test_tee_input.rb +10 -0
  94. data/test/unit/test_upload.rb +10 -15
  95. data/test/unit/test_util.rb +32 -6
  96. data/test/unit/test_waiter.rb +34 -0
  97. data/unicorn.gemspec +28 -23
  98. data/unicorn_1 +1 -0
  99. data/unicorn_rails_1 +1 -0
  100. metadata +37 -58
  101. data/.wrongdoc.yml +0 -11
  102. data/ChangeLog +0 -5027
  103. data/Documentation/GNUmakefile +0 -30
  104. data/Documentation/unicorn.1.txt +0 -178
  105. data/Documentation/unicorn_rails.1.txt +0 -175
  106. data/examples/git.ru +0 -13
  107. data/lib/unicorn/app/exec_cgi.rb +0 -154
  108. data/lib/unicorn/app/inetd.rb +0 -109
  109. data/lib/unicorn/ssl_client.rb +0 -11
  110. data/lib/unicorn/ssl_configurator.rb +0 -104
  111. data/lib/unicorn/ssl_server.rb +0 -42
  112. data/local.mk.sample +0 -59
  113. data/script/isolate_for_tests +0 -31
  114. data/t/hijack.ru +0 -42
  115. data/t/t0016-trust-x-forwarded-false.sh +0 -30
  116. data/t/t0017-trust-x-forwarded-true.sh +0 -30
  117. data/t/t0200-rack-hijack.sh +0 -27
  118. data/test/unit/test_http_parser_xftrust.rb +0 -38
  119. data/test/unit/test_sni_hostnames.rb +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e0d09e0beb210c82cd779da26aa87b47531a64be
4
- data.tar.gz: 84e371fff3dc40dd00716645d7227bae4f4a8541
2
+ SHA256:
3
+ metadata.gz: cd2fc6250af1faf8048df529538386a6974dcbd1aac58db683a710b804bae1e8
4
+ data.tar.gz: 50aeca90aada5aeb9869cf3885681fe9029bee6183c99c8b85afb3d0803b479f
5
5
  SHA512:
6
- metadata.gz: c9d40ccbff58e01074b8f1892b02150db4b0f5e49e57d69bbd109a24da4d68c26b0dda85edcbb3f3b5277690aeae6362a0ddc178c757f8671b7faf12751e1891
7
- data.tar.gz: a5a12b1bb5921dc2fb2437dbf029e92b54f4f29c8091272edaa37ee22f6ed5f384f004337aec0ecea2d3882c6793614baf2c14eeaf7d0f616b3191e426761a22
6
+ metadata.gz: 83ebf917cc17380114648c22f9cb3ad59bda6125d23781e64cd89bb8936bf17bc6bb7292933f9433f1397901022683a63b241d512b31ea1b85e5bc791a10a74e
7
+ data.tar.gz: d36730df71b5b131de61037f2838b743d587b93b1eeb70eea1956de4aabc9051485626d38debaadd3d5c3ee3c2738ca72f9a9cbc9bafb6eff9e11f08ad272275
data/.document CHANGED
@@ -10,7 +10,6 @@ SIGNALS
10
10
  KNOWN_ISSUES
11
11
  TODO
12
12
  NEWS
13
- ChangeLog
14
13
  LATEST
15
14
  lib/unicorn.rb
16
15
  lib/unicorn/configurator.rb
data/.gitattributes ADDED
@@ -0,0 +1,5 @@
1
+ *.gemspec diff=ruby
2
+ *.rb diff=ruby
3
+ *.ru diff=ruby
4
+ Rakefile diff=ruby
5
+ bin/* diff=ruby
data/.gitignore CHANGED
@@ -15,11 +15,11 @@ ext/unicorn_http/unicorn_http.c
15
15
  log/
16
16
  pkg/
17
17
  /vendor
18
- /NEWS
19
- /ChangeLog
18
+ /NEWS*
20
19
  /.manifest
21
20
  /GIT-VERSION-FILE
22
21
  /man
23
22
  /tmp
24
23
  /LATEST
25
24
  /lib/unicorn/version.rb
25
+ /*_1
data/.manifest CHANGED
@@ -1,18 +1,17 @@
1
1
  .CHANGELOG.old
2
2
  .document
3
+ .gitattributes
3
4
  .gitignore
4
5
  .mailmap
5
6
  .manifest
6
- .wrongdoc.yml
7
+ .olddoc.yml
7
8
  Application_Timeouts
8
9
  CONTRIBUTORS
9
10
  COPYING
10
- ChangeLog
11
11
  DESIGN
12
12
  Documentation/.gitignore
13
- Documentation/GNUmakefile
14
- Documentation/unicorn.1.txt
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
@@ -37,16 +36,18 @@ bin/unicorn
37
36
  bin/unicorn_rails
38
37
  examples/big_app_gc.rb
39
38
  examples/echo.ru
40
- examples/git.ru
41
39
  examples/init.sh
42
40
  examples/logger_mp_safe.rb
43
41
  examples/logrotate.conf
44
42
  examples/nginx.conf
45
43
  examples/unicorn.conf.minimal.rb
46
44
  examples/unicorn.conf.rb
45
+ examples/unicorn.socket
46
+ examples/unicorn@.service
47
47
  ext/unicorn_http/CFLAGS
48
48
  ext/unicorn_http/c_util.h
49
49
  ext/unicorn_http/common_field_optimization.h
50
+ ext/unicorn_http/epollexclusive.h
50
51
  ext/unicorn_http/ext_help.h
51
52
  ext/unicorn_http/extconf.rb
52
53
  ext/unicorn_http/global_variables.h
@@ -55,8 +56,6 @@ ext/unicorn_http/unicorn_http.c
55
56
  ext/unicorn_http/unicorn_http.rl
56
57
  ext/unicorn_http/unicorn_http_common.rl
57
58
  lib/unicorn.rb
58
- lib/unicorn/app/exec_cgi.rb
59
- lib/unicorn/app/inetd.rb
60
59
  lib/unicorn/app/old_rails.rb
61
60
  lib/unicorn/app/old_rails/static.rb
62
61
  lib/unicorn/cgi_wrapper.rb
@@ -68,20 +67,16 @@ lib/unicorn/http_server.rb
68
67
  lib/unicorn/launcher.rb
69
68
  lib/unicorn/oob_gc.rb
70
69
  lib/unicorn/preread_input.rb
70
+ lib/unicorn/select_waiter.rb
71
71
  lib/unicorn/socket_helper.rb
72
- lib/unicorn/ssl_client.rb
73
- lib/unicorn/ssl_configurator.rb
74
- lib/unicorn/ssl_server.rb
75
72
  lib/unicorn/stream_input.rb
76
73
  lib/unicorn/tee_input.rb
77
74
  lib/unicorn/tmpio.rb
78
75
  lib/unicorn/util.rb
79
76
  lib/unicorn/version.rb
80
77
  lib/unicorn/worker.rb
81
- local.mk.sample
82
78
  man/man1/unicorn.1
83
79
  man/man1/unicorn_rails.1
84
- script/isolate_for_tests
85
80
  setup.rb
86
81
  t/.gitignore
87
82
  t/GNUmakefile
@@ -94,7 +89,6 @@ t/detach.ru
94
89
  t/env.ru
95
90
  t/fails-rack-lint.ru
96
91
  t/heartbeat-timeout.ru
97
- t/hijack.ru
98
92
  t/listener_names.ru
99
93
  t/my-tap-lib.sh
100
94
  t/oob_gc.ru
@@ -124,8 +118,6 @@ t/t0013.ru
124
118
  t/t0014-rewindable-input-true.sh
125
119
  t/t0014.ru
126
120
  t/t0015-configurator-internals.sh
127
- t/t0016-trust-x-forwarded-false.sh
128
- t/t0017-trust-x-forwarded-true.sh
129
121
  t/t0018-write-on-close.sh
130
122
  t/t0019-max_header_len.sh
131
123
  t/t0020-at_exit-handler.sh
@@ -134,8 +126,9 @@ t/t0022-listener_names-preload_app.sh
134
126
  t/t0100-rack-input-tests.sh
135
127
  t/t0116-client_body_buffer_size.sh
136
128
  t/t0116.ru
137
- t/t0200-rack-hijack.sh
138
129
  t/t0300-no-default-middleware.sh
130
+ t/t0301-no-default-middleware-ignored-in-config.sh
131
+ t/t0301.ru
139
132
  t/t9000-preread-input.sh
140
133
  t/t9001-oob_gc.sh
141
134
  t/t9002-oob_gc-path.sh
@@ -144,23 +137,26 @@ t/write-on-close.ru
144
137
  test/aggregate.rb
145
138
  test/benchmark/README
146
139
  test/benchmark/dd.ru
140
+ test/benchmark/ddstream.ru
141
+ test/benchmark/readinput.ru
147
142
  test/benchmark/stack.ru
143
+ test/benchmark/uconnect.perl
148
144
  test/exec/README
149
145
  test/exec/test_exec.rb
150
146
  test/test_helper.rb
147
+ test/unit/test_ccc.rb
151
148
  test/unit/test_configurator.rb
152
149
  test/unit/test_droplet.rb
153
150
  test/unit/test_http_parser.rb
154
151
  test/unit/test_http_parser_ng.rb
155
- test/unit/test_http_parser_xftrust.rb
156
152
  test/unit/test_request.rb
157
153
  test/unit/test_response.rb
158
154
  test/unit/test_server.rb
159
155
  test/unit/test_signals.rb
160
- test/unit/test_sni_hostnames.rb
161
156
  test/unit/test_socket_helper.rb
162
157
  test/unit/test_stream_input.rb
163
158
  test/unit/test_tee_input.rb
164
159
  test/unit/test_upload.rb
165
160
  test/unit/test_util.rb
161
+ test/unit/test_waiter.rb
166
162
  unicorn.gemspec
data/.olddoc.yml ADDED
@@ -0,0 +1,25 @@
1
+ ---
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/
7
+ merge_html:
8
+ unicorn_1: Documentation/unicorn.1.html
9
+ unicorn_rails_1: Documentation/unicorn_rails.1.html
10
+ noindex:
11
+ - Unicorn::Const
12
+ - LATEST
13
+ - TODO
14
+ - unicorn_rails_1
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
@@ -4,10 +4,10 @@ This article focuses on _application_ setup for Rack applications, but
4
4
  can be expanded to all applications that connect to external resources
5
5
  and expect short response times.
6
6
 
7
- This article is not specific to \Unicorn, but exists to discourage
7
+ This article is not specific to unicorn, but exists to discourage
8
8
  the overuse of the built-in
9
9
  {timeout}[link:Unicorn/Configurator.html#method-i-timeout] directive
10
- in \Unicorn.
10
+ in unicorn.
11
11
 
12
12
  == ALL External Resources Are Considered Unreliable
13
13
 
@@ -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}[http://memcached.org/],
27
- {dalli}[http://rubygems.org/gems/dalli],
28
- {memcached}[http://rubygems.org/gems/memcached] and
29
- {memcache-client}[http://rubygems.org/gems/memcache-client] RubyGems all
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
@@ -71,7 +71,7 @@ handle network/server failures.
71
71
  == The Last Line Of Defense
72
72
 
73
73
  The {timeout}[link:Unicorn/Configurator.html#method-i-timeout] mechanism
74
- in \Unicorn is an extreme solution that should be avoided whenever
74
+ in unicorn is an extreme solution that should be avoided whenever
75
75
  possible. It will help catch bugs in your application where and when
76
76
  your application forgets to use timeouts, but it is expensive as it
77
77
  kills and respawns a worker process.
data/CONTRIBUTORS CHANGED
@@ -1,5 +1,9 @@
1
- Unicorn developers (let us know if we forgot you):
2
- * Eric Wong (BDFL, BOFH)
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/DESIGN CHANGED
@@ -7,9 +7,7 @@
7
7
  all clients down, just one. Only UNIX-like systems supporting
8
8
  fork() and file descriptor inheritance are supported.
9
9
 
10
- * The Ragel+C HTTP parser is taken from Mongrel. This is the
11
- only non-Ruby part and there are no plans to add any more
12
- non-Ruby components.
10
+ * The Ragel+C HTTP parser is taken from Mongrel.
13
11
 
14
12
  * All HTTP parsing and I/O is done much like Mongrel:
15
13
  1. read/parse HTTP request headers in full
@@ -31,7 +29,7 @@
31
29
  * One master process spawns and reaps worker processes. The
32
30
  Rack application itself is called only within the worker process (but
33
31
  can be loaded within the master). A copy-on-write friendly garbage
34
- collector like the one found in Ruby 2.0.0dev or Ruby Enterprise Edition
32
+ collector like the one found in mainline Ruby 2.0.0 and later
35
33
  can be used to minimize memory usage along with the "preload_app true"
36
34
  directive (see Unicorn::Configurator).
37
35
 
@@ -1,5 +1,3 @@
1
- *.1
2
- *.5
3
- *.7
4
1
  *.gz
5
2
  *.html
3
+ *.txt
@@ -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>.