unicorn-camilo 4.8.2.5.g0b28.dirty

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) 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 +164 -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 +4919 -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 +268 -0
  21. data/HACKING +134 -0
  22. data/ISSUES +36 -0
  23. data/KNOWN_ISSUES +79 -0
  24. data/LATEST +6 -0
  25. data/LICENSE +67 -0
  26. data/Links +56 -0
  27. data/NEWS +2089 -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 +813 -0
  66. data/lib/unicorn/launcher.rb +62 -0
  67. data/lib/unicorn/oob_gc.rb +81 -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 +210 -0
  82. data/man/man1/unicorn_rails.1 +208 -0
  83. data/script/isolate_for_tests +31 -0
  84. data/setup.rb +1586 -0
  85. data/t/.gitignore +4 -0
  86. data/t/GNUmakefile +78 -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/t0000-http-basic.sh +50 -0
  105. data/t/t0001-reload-bad-config.sh +53 -0
  106. data/t/t0002-config-conflict.sh +49 -0
  107. data/t/t0002-parser-error.sh +94 -0
  108. data/t/t0003-working_directory.sh +51 -0
  109. data/t/t0004-heartbeat-timeout.sh +69 -0
  110. data/t/t0004-working_directory_broken.sh +24 -0
  111. data/t/t0005-working_directory_app.rb.sh +40 -0
  112. data/t/t0006-reopen-logs.sh +83 -0
  113. data/t/t0006.ru +13 -0
  114. data/t/t0007-working_directory_no_embed_cli.sh +44 -0
  115. data/t/t0008-back_out_of_upgrade.sh +110 -0
  116. data/t/t0009-broken-app.sh +56 -0
  117. data/t/t0009-winch_ttin.sh +59 -0
  118. data/t/t0010-reap-logging.sh +55 -0
  119. data/t/t0011-active-unix-socket.sh +79 -0
  120. data/t/t0012-reload-empty-config.sh +85 -0
  121. data/t/t0013-rewindable-input-false.sh +24 -0
  122. data/t/t0013.ru +12 -0
  123. data/t/t0014-rewindable-input-true.sh +24 -0
  124. data/t/t0014.ru +12 -0
  125. data/t/t0015-configurator-internals.sh +25 -0
  126. data/t/t0016-trust-x-forwarded-false.sh +30 -0
  127. data/t/t0017-trust-x-forwarded-true.sh +30 -0
  128. data/t/t0018-write-on-close.sh +23 -0
  129. data/t/t0019-max_header_len.sh +49 -0
  130. data/t/t0020-at_exit-handler.sh +49 -0
  131. data/t/t0021-process_detach.sh +29 -0
  132. data/t/t0022-listener_names-preload_app.sh +32 -0
  133. data/t/t0100-rack-input-tests.sh +124 -0
  134. data/t/t0116-client_body_buffer_size.sh +80 -0
  135. data/t/t0116.ru +16 -0
  136. data/t/t0200-rack-hijack.sh +27 -0
  137. data/t/t0300-no-default-middleware.sh +20 -0
  138. data/t/t9000-preread-input.sh +48 -0
  139. data/t/t9001-oob_gc.sh +47 -0
  140. data/t/t9002-oob_gc-path.sh +75 -0
  141. data/t/test-lib.sh +128 -0
  142. data/t/write-on-close.ru +11 -0
  143. data/test/aggregate.rb +15 -0
  144. data/test/benchmark/README +50 -0
  145. data/test/benchmark/dd.ru +18 -0
  146. data/test/benchmark/stack.ru +8 -0
  147. data/test/exec/README +5 -0
  148. data/test/exec/test_exec.rb +1047 -0
  149. data/test/test_helper.rb +297 -0
  150. data/test/unit/test_configurator.rb +175 -0
  151. data/test/unit/test_droplet.rb +28 -0
  152. data/test/unit/test_http_parser.rb +854 -0
  153. data/test/unit/test_http_parser_ng.rb +731 -0
  154. data/test/unit/test_http_parser_xftrust.rb +38 -0
  155. data/test/unit/test_request.rb +182 -0
  156. data/test/unit/test_response.rb +99 -0
  157. data/test/unit/test_server.rb +268 -0
  158. data/test/unit/test_signals.rb +188 -0
  159. data/test/unit/test_sni_hostnames.rb +47 -0
  160. data/test/unit/test_socket_helper.rb +197 -0
  161. data/test/unit/test_stream_input.rb +203 -0
  162. data/test/unit/test_tee_input.rb +294 -0
  163. data/test/unit/test_upload.rb +306 -0
  164. data/test/unit/test_util.rb +105 -0
  165. data/unicorn.gemspec +44 -0
  166. metadata +326 -0
data/local.mk.sample ADDED
@@ -0,0 +1,59 @@
1
+ # this is the local.mk file used by Eric Wong on his dev boxes.
2
+ # GNUmakefile will source local.mk in the top-level source tree
3
+ # if it is present.
4
+ #
5
+ # This is depends on a bunch of GNU-isms from bash, sed, touch.
6
+
7
+ DLEXT := so
8
+
9
+ # Avoid loading rubygems to speed up tests because gmake is
10
+ # fork+exec heavy with Ruby.
11
+ prefix = $(HOME)
12
+
13
+ # XXX clean this up
14
+ ifeq ($(r192),)
15
+ ifeq ($(r19),)
16
+ ifeq ($(rbx),)
17
+ ifeq ($(r186),)
18
+ RUBY := $(prefix)/bin/ruby
19
+ else
20
+ prefix := $(prefix)/r186-p114
21
+ export PATH := $(prefix)/bin:$(PATH)
22
+ RUBY := $(prefix)/bin/ruby
23
+ endif
24
+ else
25
+ prefix := $(prefix)/rbx
26
+ export PATH := $(prefix)/bin:$(PATH)
27
+ RUBY := $(prefix)/bin/rbx
28
+ endif
29
+ else
30
+ prefix := $(prefix)/ruby-1.9
31
+ export PATH := $(prefix)/bin:$(PATH)
32
+ RUBY := $(prefix)/bin/ruby --disable-gems
33
+ endif
34
+ else
35
+ prefix := $(prefix)/ruby-1.9.2
36
+ export PATH := $(prefix)/bin:$(PATH)
37
+ RUBY := $(prefix)/bin/ruby --disable-gems
38
+ endif
39
+
40
+ # pipefail is THE reason to use bash (v3+) or never revisions of ksh93
41
+ # SHELL := /bin/bash -e -o pipefail
42
+ SHELL := /bin/ksh93 -e -o pipefail
43
+
44
+ full-test: test-18 test-191 test-192 test-rbx test-186
45
+
46
+ # FIXME: keep eye on Rubinius activity and wait for fixes from upstream
47
+ # so we don't need RBX_SKIP anymore
48
+ test-rbx: export RBX_SKIP := 1
49
+ test-rbx: export RUBY := $(RUBY)
50
+ test-rbx:
51
+ $(MAKE) test test-integration rbx=T 2>&1 |sed -e 's!^!rbx !'
52
+ test-186:
53
+ $(MAKE) test-all r186=1 2>&1 |sed 's!^!1.8.6 !'
54
+ test-18:
55
+ $(MAKE) test-all 2>&1 |sed 's!^!1.8 !'
56
+ test-191:
57
+ $(MAKE) test-all r19=1 2>&1 |sed 's!^!1.9.1 !'
58
+ test-192:
59
+ $(MAKE) test-all r192=1 2>&1 |sed 's!^!1.9.2 !'
@@ -0,0 +1,210 @@
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 last-specified
80
+ 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.
103
+ This evaluation happens 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.
119
+ PATH will be prepended to $LOAD_PATH.
120
+ The \[aq]:\[aq] character may be used to delimit multiple directories.
121
+ This directive may be used more than once.
122
+ Modifications to $LOAD_PATH take place immediately and in the order they
123
+ were specified on the command-line.
124
+ .RS
125
+ .RE
126
+ .TP
127
+ .B -r, --require LIBRARY
128
+ require a specified LIBRARY before executing the application.
129
+ The "require" statement will be executed immediately and in the order
130
+ they were specified on the command-line.
131
+ .RS
132
+ .RE
133
+ .SH SIGNALS
134
+ .PP
135
+ The following UNIX signals may be sent to the master process:
136
+ .IP \[bu] 2
137
+ HUP - reload config file, app, and gracefully restart all workers
138
+ .IP \[bu] 2
139
+ INT/TERM - quick shutdown, kills all workers immediately
140
+ .IP \[bu] 2
141
+ QUIT - graceful shutdown, waits for workers to finish their current
142
+ request before finishing.
143
+ .IP \[bu] 2
144
+ USR1 - reopen all logs owned by the master and all workers See
145
+ Unicorn::Util.reopen_logs for what is considered a log.
146
+ .IP \[bu] 2
147
+ USR2 - reexecute the running binary.
148
+ A separate QUIT should be sent to the original process once the child is
149
+ verified to be up and running.
150
+ .IP \[bu] 2
151
+ WINCH - gracefully stops workers but keep the master running.
152
+ This will only work for daemonized processes.
153
+ .IP \[bu] 2
154
+ TTIN - increment the number of worker processes by one
155
+ .IP \[bu] 2
156
+ TTOU - decrement the number of worker processes by one
157
+ .PP
158
+ See the SIGNALS (http://unicorn.bogomips.org/SIGNALS.html) document for
159
+ full description of all signals used by Unicorn.
160
+ .SH RACK ENVIRONMENT
161
+ .PP
162
+ Accepted values of RACK_ENV and the middleware they automatically load
163
+ (outside of RACKUP_FILE) are exactly as those in rackup(1):
164
+ .IP \[bu] 2
165
+ development - loads Rack::CommonLogger, Rack::ShowExceptions, and
166
+ Rack::Lint middleware
167
+ .IP \[bu] 2
168
+ deployment - loads Rack::CommonLogger middleware
169
+ .IP \[bu] 2
170
+ none - loads no middleware at all, relying entirely on RACKUP_FILE
171
+ .PP
172
+ All unrecognized values for RACK_ENV are assumed to be "none".
173
+ Production deployments are strongly encouraged to use "deployment" or
174
+ "none" for maximum performance.
175
+ .PP
176
+ As of Unicorn 0.94.0, RACK_ENV is exported as a process-wide environment
177
+ variable as well.
178
+ While not current a part of the Rack specification as of Rack 1.0.1,
179
+ this has become a de facto standard in the Rack world.
180
+ .PP
181
+ Note the Rack::ContentLength and Rack::Chunked middlewares are also
182
+ loaded by "deployment" and "development", but no other values of
183
+ RACK_ENV.
184
+ If needed, they must be individually specified in the RACKUP_FILE, some
185
+ frameworks do not require them.
186
+ .SH ENVIRONMENT VARIABLES
187
+ .PP
188
+ The RACK_ENV variable is set by the aforementioned -E switch.
189
+ All application or library-specific environment variables (e.g.
190
+ TMPDIR) may always be set in the Unicorn CONFIG_FILE in addition to the
191
+ spawning shell.
192
+ When transparently upgrading Unicorn, all environment variables set in
193
+ the old master process are inherited by the new master process.
194
+ Unicorn only uses (and will overwrite) the UNICORN_FD environment
195
+ variable internally when doing transparent upgrades.
196
+ .SH SEE ALSO
197
+ .IP \[bu] 2
198
+ unicorn_rails(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,208 @@
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 HTTP
5
+ 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 last-specified
85
+ 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 last-specified
94
+ 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 parsed.
112
+ .RS
113
+ .RE
114
+ .TP
115
+ .B -d, --debug
116
+ Turn on debug mode, the $DEBUG variable is set to true.
117
+ For Rails >= 2.3.x, this loads the \f[I]Rails::Rack::Debugger\f[]
118
+ middleware.
119
+ .RS
120
+ .RE
121
+ .TP
122
+ .B -w, --warn
123
+ Turn on verbose warnings, the $VERBOSE variable is set to true.
124
+ .RS
125
+ .RE
126
+ .TP
127
+ .B -I, --include PATH
128
+ specify $LOAD_PATH.
129
+ PATH will be prepended to $LOAD_PATH.
130
+ The \[aq]:\[aq] character may be used to delimit multiple directories.
131
+ This directive may be used more than once.
132
+ Modifications to $LOAD_PATH take place immediately and in the order they
133
+ were specified on the command-line.
134
+ .RS
135
+ .RE
136
+ .TP
137
+ .B -r, --require LIBRARY
138
+ require a specified LIBRARY before executing the application.
139
+ The "require" statement will be executed immediately and in the order
140
+ they were specified on the command-line.
141
+ .RS
142
+ .RE
143
+ .SH RACKUP FILE
144
+ .PP
145
+ This defaults to "config.ru" in RAILS_ROOT.
146
+ It should be the same file used by rackup(1) and other Rack launchers,
147
+ it uses the \f[I]Rack::Builder\f[] DSL.
148
+ Unlike many other Rack applications, RACKUP_FILE is completely
149
+ \f[I]optional\f[] for Rails, but may be used to disable some of the
150
+ default middleware for performance.
151
+ .PP
152
+ Embedded command-line options are mostly parsed for compatibility with
153
+ rackup(1) but strongly discouraged.
154
+ .SH ENVIRONMENT VARIABLES
155
+ .PP
156
+ The RAILS_ENV variable is set by the aforementioned -E switch.
157
+ The RAILS_RELATIVE_URL_ROOT is set by the aforementioned --path switch.
158
+ Either of these variables may also be set in the shell or the Unicorn
159
+ CONFIG_FILE.
160
+ All application or library-specific environment variables (e.g.
161
+ TMPDIR, RAILS_ASSET_ID) may always be set in the Unicorn CONFIG_FILE in
162
+ addition to the spawning shell.
163
+ When transparently upgrading Unicorn, all environment variables set in
164
+ the old master process are inherited by the new master process.
165
+ Unicorn only uses (and will overwrite) the UNICORN_FD environment
166
+ variable internally when doing transparent upgrades.
167
+ .SH SIGNALS
168
+ .PP
169
+ The following UNIX signals may be sent to the master process:
170
+ .IP \[bu] 2
171
+ HUP - reload config file, app, and gracefully restart all workers
172
+ .IP \[bu] 2
173
+ INT/TERM - quick shutdown, kills all workers immediately
174
+ .IP \[bu] 2
175
+ QUIT - graceful shutdown, waits for workers to finish their current
176
+ request before finishing.
177
+ .IP \[bu] 2
178
+ USR1 - reopen all logs owned by the master and all workers See
179
+ Unicorn::Util.reopen_logs for what is considered a log.
180
+ .IP \[bu] 2
181
+ USR2 - reexecute the running binary.
182
+ A separate QUIT should be sent to the original process once the child is
183
+ verified to be up and running.
184
+ .IP \[bu] 2
185
+ WINCH - gracefully stops workers but keep the master running.
186
+ This will only work for daemonized processes.
187
+ .IP \[bu] 2
188
+ TTIN - increment the number of worker processes by one
189
+ .IP \[bu] 2
190
+ TTOU - decrement the number of worker processes by one
191
+ .PP
192
+ See the SIGNALS (http://unicorn.bogomips.org/SIGNALS.html) document for
193
+ full description of all signals used by Unicorn.
194
+ .SH SEE ALSO
195
+ .IP \[bu] 2
196
+ unicorn(1)
197
+ .IP \[bu] 2
198
+ \f[I]Rack::Builder\f[] ri/RDoc
199
+ .IP \[bu] 2
200
+ \f[I]Unicorn::Configurator\f[] ri/RDoc
201
+ .IP \[bu] 2
202
+ Unicorn RDoc (http://unicorn.bogomips.org/)
203
+ .IP \[bu] 2
204
+ Rack RDoc (http://rack.rubyforge.org/doc/)
205
+ .IP \[bu] 2
206
+ Rackup HowTo (http://wiki.github.com/rack/rack/tutorial-rackup-howto)
207
+ .SH AUTHORS
208
+ The Unicorn Community <mongrel-unicorn@rubyforge.org>.
@@ -0,0 +1,31 @@
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.13.0'
20
+ gem 'kgio', '2.9.2'
21
+ gem 'rack', '1.5.2'
22
+ end
23
+ end
24
+ _, status = Process.waitpid2(pid)
25
+ status.success? or abort status.inspect
26
+ lib_paths = Dir["#{opts[:path]}/gems/*-*/lib"].map { |x| File.expand_path(x) }
27
+ dst = "tmp/isolate/#{ruby_engine}-#{RUBY_VERSION}.mk"
28
+ File.open("#{dst}.#$$", "w") do |fp|
29
+ fp.puts "ISOLATE_LIBS=#{lib_paths.join(':')}"
30
+ end
31
+ File.rename("#{dst}.#$$", dst)