unicorn-heroku-wait 4.8.0.1.g0ed2.dirty

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +7 -0
  2. data/.CHANGELOG.old +25 -0
  3. data/.document +29 -0
  4. data/.gitignore +25 -0
  5. data/.mailmap +26 -0
  6. data/.manifest +166 -0
  7. data/.wrongdoc.yml +10 -0
  8. data/Application_Timeouts +77 -0
  9. data/CONTRIBUTORS +35 -0
  10. data/COPYING +674 -0
  11. data/ChangeLog +4861 -0
  12. data/DESIGN +97 -0
  13. data/Documentation/.gitignore +5 -0
  14. data/Documentation/GNUmakefile +30 -0
  15. data/Documentation/unicorn.1.txt +178 -0
  16. data/Documentation/unicorn_rails.1.txt +175 -0
  17. data/FAQ +53 -0
  18. data/GIT-VERSION-FILE +1 -0
  19. data/GIT-VERSION-GEN +39 -0
  20. data/GNUmakefile +267 -0
  21. data/HACKING +134 -0
  22. data/ISSUES +36 -0
  23. data/KNOWN_ISSUES +79 -0
  24. data/LATEST +28 -0
  25. data/LICENSE +67 -0
  26. data/Links +56 -0
  27. data/NEWS +2067 -0
  28. data/PHILOSOPHY +145 -0
  29. data/README +150 -0
  30. data/Rakefile +60 -0
  31. data/SIGNALS +123 -0
  32. data/Sandbox +103 -0
  33. data/TODO +5 -0
  34. data/TUNING +98 -0
  35. data/bin/unicorn +126 -0
  36. data/bin/unicorn_rails +209 -0
  37. data/examples/big_app_gc.rb +2 -0
  38. data/examples/echo.ru +27 -0
  39. data/examples/git.ru +13 -0
  40. data/examples/init.sh +74 -0
  41. data/examples/logger_mp_safe.rb +25 -0
  42. data/examples/logrotate.conf +29 -0
  43. data/examples/nginx.conf +156 -0
  44. data/examples/unicorn.conf.minimal.rb +13 -0
  45. data/examples/unicorn.conf.rb +102 -0
  46. data/ext/unicorn_http/CFLAGS +13 -0
  47. data/ext/unicorn_http/c_util.h +124 -0
  48. data/ext/unicorn_http/common_field_optimization.h +111 -0
  49. data/ext/unicorn_http/ext_help.h +82 -0
  50. data/ext/unicorn_http/extconf.rb +10 -0
  51. data/ext/unicorn_http/global_variables.h +97 -0
  52. data/ext/unicorn_http/httpdate.c +78 -0
  53. data/ext/unicorn_http/unicorn_http.c +4031 -0
  54. data/ext/unicorn_http/unicorn_http.rl +1036 -0
  55. data/ext/unicorn_http/unicorn_http_common.rl +76 -0
  56. data/lib/unicorn/app/exec_cgi.rb +154 -0
  57. data/lib/unicorn/app/inetd.rb +109 -0
  58. data/lib/unicorn/app/old_rails/static.rb +59 -0
  59. data/lib/unicorn/app/old_rails.rb +35 -0
  60. data/lib/unicorn/cgi_wrapper.rb +147 -0
  61. data/lib/unicorn/configurator.rb +679 -0
  62. data/lib/unicorn/const.rb +44 -0
  63. data/lib/unicorn/http_request.rb +122 -0
  64. data/lib/unicorn/http_response.rb +75 -0
  65. data/lib/unicorn/http_server.rb +803 -0
  66. data/lib/unicorn/launcher.rb +62 -0
  67. data/lib/unicorn/oob_gc.rb +71 -0
  68. data/lib/unicorn/preread_input.rb +33 -0
  69. data/lib/unicorn/socket_helper.rb +231 -0
  70. data/lib/unicorn/ssl_client.rb +11 -0
  71. data/lib/unicorn/ssl_configurator.rb +104 -0
  72. data/lib/unicorn/ssl_server.rb +42 -0
  73. data/lib/unicorn/stream_input.rb +146 -0
  74. data/lib/unicorn/tee_input.rb +126 -0
  75. data/lib/unicorn/tmpio.rb +29 -0
  76. data/lib/unicorn/util.rb +89 -0
  77. data/lib/unicorn/version.rb +1 -0
  78. data/lib/unicorn/worker.rb +152 -0
  79. data/lib/unicorn.rb +118 -0
  80. data/local.mk.sample +59 -0
  81. data/man/man1/unicorn.1 +211 -0
  82. data/man/man1/unicorn_rails.1 +210 -0
  83. data/script/isolate_for_tests +32 -0
  84. data/setup.rb +1586 -0
  85. data/t/.gitignore +5 -0
  86. data/t/GNUmakefile +82 -0
  87. data/t/README +42 -0
  88. data/t/bin/content-md5-put +36 -0
  89. data/t/bin/sha1sum.rb +17 -0
  90. data/t/bin/unused_listen +40 -0
  91. data/t/broken-app.ru +12 -0
  92. data/t/detach.ru +11 -0
  93. data/t/env.ru +3 -0
  94. data/t/fails-rack-lint.ru +5 -0
  95. data/t/heartbeat-timeout.ru +12 -0
  96. data/t/hijack.ru +42 -0
  97. data/t/listener_names.ru +4 -0
  98. data/t/my-tap-lib.sh +201 -0
  99. data/t/oob_gc.ru +20 -0
  100. data/t/oob_gc_path.ru +20 -0
  101. data/t/pid.ru +3 -0
  102. data/t/preread_input.ru +17 -0
  103. data/t/rack-input-tests.ru +21 -0
  104. data/t/sslgen.sh +71 -0
  105. data/t/t0000-http-basic.sh +50 -0
  106. data/t/t0001-reload-bad-config.sh +53 -0
  107. data/t/t0002-config-conflict.sh +49 -0
  108. data/t/t0002-parser-error.sh +94 -0
  109. data/t/t0003-working_directory.sh +51 -0
  110. data/t/t0004-heartbeat-timeout.sh +69 -0
  111. data/t/t0004-working_directory_broken.sh +24 -0
  112. data/t/t0005-working_directory_app.rb.sh +40 -0
  113. data/t/t0006-reopen-logs.sh +83 -0
  114. data/t/t0006.ru +13 -0
  115. data/t/t0007-working_directory_no_embed_cli.sh +44 -0
  116. data/t/t0008-back_out_of_upgrade.sh +110 -0
  117. data/t/t0009-broken-app.sh +56 -0
  118. data/t/t0009-winch_ttin.sh +59 -0
  119. data/t/t0010-reap-logging.sh +55 -0
  120. data/t/t0011-active-unix-socket.sh +79 -0
  121. data/t/t0012-reload-empty-config.sh +85 -0
  122. data/t/t0013-rewindable-input-false.sh +24 -0
  123. data/t/t0013.ru +12 -0
  124. data/t/t0014-rewindable-input-true.sh +24 -0
  125. data/t/t0014.ru +12 -0
  126. data/t/t0015-configurator-internals.sh +25 -0
  127. data/t/t0016-trust-x-forwarded-false.sh +30 -0
  128. data/t/t0017-trust-x-forwarded-true.sh +30 -0
  129. data/t/t0018-write-on-close.sh +23 -0
  130. data/t/t0019-max_header_len.sh +49 -0
  131. data/t/t0020-at_exit-handler.sh +49 -0
  132. data/t/t0021-process_detach.sh +29 -0
  133. data/t/t0022-listener_names-preload_app.sh +32 -0
  134. data/t/t0100-rack-input-tests.sh +124 -0
  135. data/t/t0116-client_body_buffer_size.sh +80 -0
  136. data/t/t0116.ru +16 -0
  137. data/t/t0200-rack-hijack.sh +27 -0
  138. data/t/t0300-no-default-middleware.sh +20 -0
  139. data/t/t0600-https-server-basic.sh +48 -0
  140. data/t/t9000-preread-input.sh +48 -0
  141. data/t/t9001-oob_gc.sh +47 -0
  142. data/t/t9002-oob_gc-path.sh +75 -0
  143. data/t/test-lib.sh +128 -0
  144. data/t/write-on-close.ru +11 -0
  145. data/test/aggregate.rb +15 -0
  146. data/test/benchmark/README +50 -0
  147. data/test/benchmark/dd.ru +18 -0
  148. data/test/benchmark/stack.ru +8 -0
  149. data/test/exec/README +5 -0
  150. data/test/exec/test_exec.rb +1047 -0
  151. data/test/test_helper.rb +297 -0
  152. data/test/unit/test_configurator.rb +175 -0
  153. data/test/unit/test_droplet.rb +28 -0
  154. data/test/unit/test_http_parser.rb +854 -0
  155. data/test/unit/test_http_parser_ng.rb +731 -0
  156. data/test/unit/test_http_parser_xftrust.rb +38 -0
  157. data/test/unit/test_request.rb +182 -0
  158. data/test/unit/test_response.rb +99 -0
  159. data/test/unit/test_server.rb +268 -0
  160. data/test/unit/test_signals.rb +188 -0
  161. data/test/unit/test_sni_hostnames.rb +47 -0
  162. data/test/unit/test_socket_helper.rb +197 -0
  163. data/test/unit/test_stream_input.rb +203 -0
  164. data/test/unit/test_tee_input.rb +294 -0
  165. data/test/unit/test_upload.rb +306 -0
  166. data/test/unit/test_util.rb +105 -0
  167. data/unicorn.gemspec +44 -0
  168. metadata +328 -0
@@ -0,0 +1,211 @@
1
+ .TH "UNICORN" "1" "September 15, 2009" "Unicorn User Manual" ""
2
+ .SH NAME
3
+ .PP
4
+ unicorn \- a rackup\-like command to launch the Unicorn HTTP server
5
+ .SH SYNOPSIS
6
+ .PP
7
+ unicorn [\-c CONFIG_FILE] [\-E RACK_ENV] [\-D] [RACKUP_FILE]
8
+ .SH DESCRIPTION
9
+ .PP
10
+ A rackup(1)\-like command to launch Rack applications using Unicorn.
11
+ It is expected to be started in your application root (APP_ROOT), but
12
+ the "working_directory" directive may be used in the CONFIG_FILE.
13
+ .PP
14
+ While unicorn takes a myriad of command\-line options for compatibility
15
+ with ruby(1) and rackup(1), it is recommended to stick to the few
16
+ command\-line options specified in the SYNOPSIS and use the CONFIG_FILE
17
+ as much as possible.
18
+ .SH RACKUP FILE
19
+ .PP
20
+ This defaults to "config.ru" in APP_ROOT.
21
+ It should be the same file used by rackup(1) and other Rack launchers,
22
+ it uses the \f[I]Rack::Builder\f[] DSL.
23
+ .PP
24
+ Embedded command\-line options are mostly parsed for compatibility with
25
+ rackup(1) but strongly discouraged.
26
+ .SH UNICORN OPTIONS
27
+ .TP
28
+ .B \-c, \-\-config\-file CONFIG_FILE
29
+ Path to the Unicorn\-specific config file.
30
+ The config file is 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
32
+ full list of directives available from the DSL.
33
+ Using an absolute path for for CONFIG_FILE is recommended as it makes
34
+ multiple instances of Unicorn easily distinguishable when viewing ps(1)
35
+ output.
36
+ .RS
37
+ .RE
38
+ .TP
39
+ .B \-D, \-\-daemonize
40
+ Run daemonized in the background.
41
+ The process is detached from the controlling terminal and stdin is
42
+ redirected to "/dev/null".
43
+ Unlike many common UNIX daemons, we do not chdir to "/" upon
44
+ daemonization to allow more control over the startup/upgrade process.
45
+ Unless specified in the CONFIG_FILE, stderr and stdout will also be
46
+ redirected to "/dev/null".
47
+ .RS
48
+ .RE
49
+ .TP
50
+ .B \-E, \-\-env RACK_ENV
51
+ Run under the given RACK_ENV.
52
+ See the RACK ENVIRONMENT section for more details.
53
+ .RS
54
+ .RE
55
+ .TP
56
+ .B \-l, \-\-listen ADDRESS
57
+ Listens on a given ADDRESS.
58
+ ADDRESS may be in the form of HOST:PORT or PATH, HOST:PORT is taken to
59
+ mean a TCP socket and PATH is meant to be a path to a UNIX domain
60
+ socket.
61
+ Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080) For
62
+ production deployments, specifying the "listen" directive in CONFIG_FILE
63
+ is recommended as it allows fine\-tuning of socket options.
64
+ .RS
65
+ .RE
66
+ .TP
67
+ .B \-N, \-\-no\-default\-middleware
68
+ Disables loading middleware implied by RACK_ENV.
69
+ This bypasses the configuration documented in the RACK ENVIRONMENT
70
+ section, but still allows RACK_ENV to be used for
71
+ 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 "0.0.0.0" (all
78
+ 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
89
+ last\-specified 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.
103
+ This evaluation happens immediately as the command\-line is being
104
+ parsed.
105
+ .RS
106
+ .RE
107
+ .TP
108
+ .B \-d, \-\-debug
109
+ Turn on debug mode, the $DEBUG variable is set to true.
110
+ .RS
111
+ .RE
112
+ .TP
113
+ .B \-w, \-\-warn
114
+ Turn on verbose warnings, the $VERBOSE variable is set to true.
115
+ .RS
116
+ .RE
117
+ .TP
118
+ .B \-I, \-\-include PATH
119
+ specify
120
+ \f[I]L\f[]\f[I]O\f[]\f[I]A\f[]\f[I]D\f[]~\f[I]P\f[]~\f[I]A\f[]\f[I]T\f[]\f[I]H\f[].\f[I]P\f[]\f[I]A\f[]\f[I]T\f[]\f[I]H\f[]\f[I]w\f[]\f[I]i\f[]\f[I]l\f[]\f[I]l\f[]\f[I]b\f[]\f[I]e\f[]\f[I]p\f[]\f[I]r\f[]\f[I]e\f[]\f[I]p\f[]\f[I]e\f[]\f[I]n\f[]\f[I]d\f[]\f[I]e\f[]\f[I]d\f[]\f[I]t\f[]\f[I]o\f[]LOAD_PATH.
121
+ The \[aq]:\[aq] character may be used to delimit multiple directories.
122
+ This directive may be used more than once.
123
+ Modifications to $LOAD_PATH take place immediately and in the order they
124
+ were specified on the command\-line.
125
+ .RS
126
+ .RE
127
+ .TP
128
+ .B \-r, \-\-require LIBRARY
129
+ require a specified LIBRARY before executing the application.
130
+ The "require" statement will be executed immediately and in the order
131
+ they were specified on the command\-line.
132
+ .RS
133
+ .RE
134
+ .SH SIGNALS
135
+ .PP
136
+ The following UNIX signals may be sent to the master process:
137
+ .IP \[bu] 2
138
+ HUP \- reload config file, app, and gracefully restart all workers
139
+ .IP \[bu] 2
140
+ INT/TERM \- quick shutdown, kills all workers immediately
141
+ .IP \[bu] 2
142
+ QUIT \- graceful shutdown, waits for workers to finish their current
143
+ request before finishing.
144
+ .IP \[bu] 2
145
+ USR1 \- reopen all logs owned by the master and all workers See
146
+ Unicorn::Util.reopen_logs for what is considered a log.
147
+ .IP \[bu] 2
148
+ USR2 \- reexecute the running binary.
149
+ A separate QUIT should be sent to the original process once the child is
150
+ verified to be up and running.
151
+ .IP \[bu] 2
152
+ WINCH \- gracefully stops workers but keep the master running.
153
+ This will only work for daemonized processes.
154
+ .IP \[bu] 2
155
+ TTIN \- increment the number of worker processes by one
156
+ .IP \[bu] 2
157
+ TTOU \- decrement the number of worker processes by one
158
+ .PP
159
+ See the SIGNALS (http://unicorn.bogomips.org/SIGNALS.html) document for
160
+ full description of all signals used by Unicorn.
161
+ .SH RACK ENVIRONMENT
162
+ .PP
163
+ Accepted values of RACK_ENV and the middleware they automatically load
164
+ (outside of RACKUP_FILE) are exactly as those in rackup(1):
165
+ .IP \[bu] 2
166
+ development \- loads Rack::CommonLogger, Rack::ShowExceptions, and
167
+ Rack::Lint middleware
168
+ .IP \[bu] 2
169
+ deployment \- loads Rack::CommonLogger middleware
170
+ .IP \[bu] 2
171
+ none \- loads no middleware at all, relying entirely on RACKUP_FILE
172
+ .PP
173
+ All unrecognized values for RACK_ENV are assumed to be "none".
174
+ Production deployments are strongly encouraged to use "deployment" or
175
+ "none" for maximum performance.
176
+ .PP
177
+ As of Unicorn 0.94.0, RACK_ENV is exported as a process\-wide
178
+ environment variable as well.
179
+ While not current a part of the Rack specification as of Rack 1.0.1,
180
+ this has become a de facto standard in the Rack world.
181
+ .PP
182
+ Note the Rack::ContentLength and Rack::Chunked middlewares are also
183
+ loaded by "deployment" and "development", but no other values of
184
+ RACK_ENV.
185
+ If needed, they must be individually specified in the RACKUP_FILE, some
186
+ frameworks do not require them.
187
+ .SH ENVIRONMENT VARIABLES
188
+ .PP
189
+ The RACK_ENV variable is set by the aforementioned \-E switch.
190
+ All application or library\-specific environment variables (e.g.
191
+ TMPDIR) may always be set in the Unicorn CONFIG_FILE in addition to the
192
+ spawning shell.
193
+ When transparently upgrading Unicorn, all environment variables set in
194
+ the old master process are inherited by the new master process.
195
+ Unicorn only uses (and will overwrite) the UNICORN_FD environment
196
+ variable internally when doing transparent upgrades.
197
+ .SH SEE ALSO
198
+ .IP \[bu] 2
199
+ unicorn_rails(1)
200
+ .IP \[bu] 2
201
+ \f[I]Rack::Builder\f[] ri/RDoc
202
+ .IP \[bu] 2
203
+ \f[I]Unicorn::Configurator\f[] ri/RDoc
204
+ .IP \[bu] 2
205
+ Unicorn RDoc (http://unicorn.bogomips.org/)
206
+ .IP \[bu] 2
207
+ Rack RDoc (http://rack.rubyforge.org/doc/)
208
+ .IP \[bu] 2
209
+ Rackup HowTo (http://wiki.github.com/rack/rack/tutorial-rackup-howto)
210
+ .SH AUTHORS
211
+ The Unicorn Community <mongrel-unicorn@rubyforge.org>.
@@ -0,0 +1,210 @@
1
+ .TH "UNICORN_RAILS" "1" "September 17, 2009" "Unicorn User Manual" ""
2
+ .SH NAME
3
+ .PP
4
+ unicorn_rails \- a script/server\-like command to launch the Unicorn
5
+ HTTP server
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 Rails applications using Unicorn.
12
+ It is expected to be started in your Rails application root
13
+ (RAILS_ROOT), but the "working_directory" directive may be used in the
14
+ CONFIG_FILE.
15
+ .PP
16
+ It is designed to help Rails 1.x and 2.y users transition to Rack, but
17
+ it is NOT needed for Rails 3 applications.
18
+ Rails 3 users are encouraged to use unicorn(1) instead of
19
+ unicorn_rails(1).
20
+ Users of Rails 1.x/2.y may also use unicorn(1) instead of
21
+ unicorn_rails(1).
22
+ .PP
23
+ The outward interface resembles rackup(1), the internals and default
24
+ middleware loading is designed like the \f[C]script/server\f[] command
25
+ distributed with Rails.
26
+ .PP
27
+ While Unicorn takes a myriad of command\-line options for compatibility
28
+ with ruby(1) and rackup(1), it is recommended to stick to the few
29
+ command\-line options specified in the SYNOPSIS and use the CONFIG_FILE
30
+ as much as possible.
31
+ .SH UNICORN OPTIONS
32
+ .TP
33
+ .B \-c, \-\-config\-file CONFIG_FILE
34
+ Path to the Unicorn\-specific config file.
35
+ The config file is implemented as a Ruby DSL, so Ruby code may executed.
36
+ See the RDoc/ri for the \f[I]Unicorn::Configurator\f[] class for the
37
+ full list of directives available from the DSL.
38
+ Using an absolute path for for CONFIG_FILE is recommended as it makes
39
+ multiple instances of Unicorn easily distinguishable when viewing ps(1)
40
+ output.
41
+ .RS
42
+ .RE
43
+ .TP
44
+ .B \-D, \-\-daemonize
45
+ Run daemonized in the background.
46
+ The process is detached from the controlling terminal and stdin is
47
+ redirected to "/dev/null".
48
+ Unlike many common UNIX daemons, we do not chdir to "/" upon
49
+ daemonization to allow more control over the startup/upgrade process.
50
+ Unless specified in the CONFIG_FILE, stderr and stdout will also be
51
+ redirected to "/dev/null".
52
+ Daemonization will \f[I]skip\f[] loading of the
53
+ \f[I]Rails::Rack::LogTailer\f[] middleware under Rails >= 2.3.x.
54
+ By default, unicorn_rails(1) will create a PID file in
55
+ \f[I]"RAILS_ROOT/tmp/pids/unicorn.pid"\f[].
56
+ You may override this by specifying the "pid" directive to override this
57
+ Unicorn config file.
58
+ .RS
59
+ .RE
60
+ .TP
61
+ .B \-E, \-\-env RAILS_ENV
62
+ Run under the given RAILS_ENV.
63
+ This sets the RAILS_ENV environment variable.
64
+ Acceptable values are exactly those you expect in your Rails
65
+ application, typically "development" or "production".
66
+ .RS
67
+ .RE
68
+ .TP
69
+ .B \-l, \-\-listen ADDRESS
70
+ Listens on a given ADDRESS.
71
+ ADDRESS may be in the form of HOST:PORT or PATH, HOST:PORT is taken to
72
+ mean a TCP socket and PATH is meant to be a path to a UNIX domain
73
+ socket.
74
+ Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080).
75
+ For production deployments, specifying the "listen" directive in
76
+ CONFIG_FILE is recommended as it allows fine\-tuning of socket options.
77
+ .RS
78
+ .RE
79
+ .SH RACKUP COMPATIBILITY OPTIONS
80
+ .TP
81
+ .B \-o, \-\-host HOST
82
+ Listen on a TCP socket belonging to HOST, default is "0.0.0.0" (all
83
+ addresses).
84
+ If specified multiple times on the command\-line, only the
85
+ last\-specified value takes effect.
86
+ This option only exists for compatibility with the rackup(1) command,
87
+ use of "\-l"/"\-\-listen" switch is recommended instead.
88
+ .RS
89
+ .RE
90
+ .TP
91
+ .B \-p, \-\-port PORT
92
+ Listen on the specified TCP PORT, default is 8080.
93
+ If specified multiple times on the command\-line, only the
94
+ last\-specified value takes effect.
95
+ This option only exists for compatibility with the rackup(1) command,
96
+ use of "\-l"/"\-\-listen" switch is recommended instead.
97
+ .RS
98
+ .RE
99
+ .TP
100
+ .B \-\-path PATH
101
+ Mounts the Rails application at the given PATH (instead of "/").
102
+ This is equivalent to setting the RAILS_RELATIVE_URL_ROOT environment
103
+ variable.
104
+ This is only supported under Rails 2.3 or later at the moment.
105
+ .RS
106
+ .RE
107
+ .SH RUBY OPTIONS
108
+ .TP
109
+ .B \-e, \-\-eval LINE
110
+ Evaluate a LINE of Ruby code.
111
+ This evaluation happens immediately as the command\-line is being
112
+ parsed.
113
+ .RS
114
+ .RE
115
+ .TP
116
+ .B \-d, \-\-debug
117
+ Turn on debug mode, the $DEBUG variable is set to true.
118
+ For Rails >= 2.3.x, this loads the \f[I]Rails::Rack::Debugger\f[]
119
+ middleware.
120
+ .RS
121
+ .RE
122
+ .TP
123
+ .B \-w, \-\-warn
124
+ Turn on verbose warnings, the $VERBOSE variable is set to true.
125
+ .RS
126
+ .RE
127
+ .TP
128
+ .B \-I, \-\-include PATH
129
+ specify
130
+ \f[I]L\f[]\f[I]O\f[]\f[I]A\f[]\f[I]D\f[]~\f[I]P\f[]~\f[I]A\f[]\f[I]T\f[]\f[I]H\f[].\f[I]P\f[]\f[I]A\f[]\f[I]T\f[]\f[I]H\f[]\f[I]w\f[]\f[I]i\f[]\f[I]l\f[]\f[I]l\f[]\f[I]b\f[]\f[I]e\f[]\f[I]p\f[]\f[I]r\f[]\f[I]e\f[]\f[I]p\f[]\f[I]e\f[]\f[I]n\f[]\f[I]d\f[]\f[I]e\f[]\f[I]d\f[]\f[I]t\f[]\f[I]o\f[]LOAD_PATH.
131
+ The \[aq]:\[aq] character may be used to delimit multiple directories.
132
+ This directive may be used more than once.
133
+ Modifications to $LOAD_PATH take place immediately and in the order they
134
+ were specified on the command\-line.
135
+ .RS
136
+ .RE
137
+ .TP
138
+ .B \-r, \-\-require LIBRARY
139
+ require a specified LIBRARY before executing the application.
140
+ The "require" statement will be executed immediately and in the order
141
+ they were specified on the command\-line.
142
+ .RS
143
+ .RE
144
+ .SH RACKUP FILE
145
+ .PP
146
+ This defaults to "config.ru" in RAILS_ROOT.
147
+ It should be the same file used by rackup(1) and other Rack launchers,
148
+ it uses the \f[I]Rack::Builder\f[] DSL.
149
+ Unlike many other Rack applications, RACKUP_FILE is completely
150
+ \f[I]optional\f[] for Rails, but may be used to disable some of the
151
+ default middleware for performance.
152
+ .PP
153
+ Embedded command\-line options are mostly parsed for compatibility with
154
+ rackup(1) but strongly discouraged.
155
+ .SH ENVIRONMENT VARIABLES
156
+ .PP
157
+ The RAILS_ENV variable is set by the aforementioned \-E switch.
158
+ The RAILS_RELATIVE_URL_ROOT is set by the aforementioned \-\-path
159
+ switch.
160
+ Either of these variables may also be set in the shell or the Unicorn
161
+ CONFIG_FILE.
162
+ All application or library\-specific environment variables (e.g.
163
+ TMPDIR, RAILS_ASSET_ID) may always be set in the Unicorn CONFIG_FILE in
164
+ addition to the spawning shell.
165
+ When transparently upgrading Unicorn, all environment variables set in
166
+ the old master process are inherited by the new master process.
167
+ Unicorn only uses (and will overwrite) the UNICORN_FD environment
168
+ variable internally when doing transparent upgrades.
169
+ .SH SIGNALS
170
+ .PP
171
+ The following UNIX signals may be sent to the master process:
172
+ .IP \[bu] 2
173
+ HUP \- reload config file, app, and gracefully restart all workers
174
+ .IP \[bu] 2
175
+ INT/TERM \- quick shutdown, kills all workers immediately
176
+ .IP \[bu] 2
177
+ QUIT \- graceful shutdown, waits for workers to finish their current
178
+ request before finishing.
179
+ .IP \[bu] 2
180
+ USR1 \- reopen all logs owned by the master and all workers See
181
+ Unicorn::Util.reopen_logs for what is considered a log.
182
+ .IP \[bu] 2
183
+ USR2 \- reexecute the running binary.
184
+ A separate QUIT should be sent to the original process once the child is
185
+ verified to be up and running.
186
+ .IP \[bu] 2
187
+ WINCH \- gracefully stops workers but keep the master running.
188
+ This will only work for daemonized processes.
189
+ .IP \[bu] 2
190
+ TTIN \- increment the number of worker processes by one
191
+ .IP \[bu] 2
192
+ TTOU \- decrement the number of worker processes by one
193
+ .PP
194
+ See the SIGNALS (http://unicorn.bogomips.org/SIGNALS.html) document for
195
+ full description of all signals used by Unicorn.
196
+ .SH SEE ALSO
197
+ .IP \[bu] 2
198
+ unicorn(1)
199
+ .IP \[bu] 2
200
+ \f[I]Rack::Builder\f[] ri/RDoc
201
+ .IP \[bu] 2
202
+ \f[I]Unicorn::Configurator\f[] ri/RDoc
203
+ .IP \[bu] 2
204
+ Unicorn RDoc (http://unicorn.bogomips.org/)
205
+ .IP \[bu] 2
206
+ Rack RDoc (http://rack.rubyforge.org/doc/)
207
+ .IP \[bu] 2
208
+ Rackup HowTo (http://wiki.github.com/rack/rack/tutorial-rackup-howto)
209
+ .SH AUTHORS
210
+ The Unicorn Community <mongrel-unicorn@rubyforge.org>.
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ # scripts/Makefiles can read and eval the output of this script and
3
+ # use it as RUBYLIB
4
+ require 'rubygems'
5
+ require 'isolate'
6
+ fp = File.open(__FILE__, "rb")
7
+ fp.flock(File::LOCK_EX)
8
+
9
+ ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
10
+ opts = {
11
+ :system => false,
12
+ # we want "ruby-1.8.7" and not "ruby-1.8", so disable :multiruby
13
+ :multiruby => false,
14
+ :path => "tmp/isolate/#{ruby_engine}-#{RUBY_VERSION}",
15
+ }
16
+
17
+ pid = fork do
18
+ Isolate.now!(opts) do
19
+ gem 'raindrops', '0.12.0'
20
+ gem 'kgio-monkey', '0.4.0'
21
+ gem 'kgio', '2.8.1'
22
+ gem 'rack', '1.5.2'
23
+ end
24
+ end
25
+ _, status = Process.waitpid2(pid)
26
+ status.success? or abort status.inspect
27
+ lib_paths = Dir["#{opts[:path]}/gems/*-*/lib"].map { |x| File.expand_path(x) }
28
+ dst = "tmp/isolate/#{ruby_engine}-#{RUBY_VERSION}.mk"
29
+ File.open("#{dst}.#$$", "w") do |fp|
30
+ fp.puts "ISOLATE_LIBS=#{lib_paths.join(':')}"
31
+ end
32
+ File.rename("#{dst}.#$$", dst)