unicorn 0.91.0 → 0.92.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.
Files changed (96) hide show
  1. data/{CHANGELOG → .CHANGELOG.old} +0 -0
  2. data/.document +4 -0
  3. data/.gitignore +5 -0
  4. data/.mailmap +26 -0
  5. data/CONTRIBUTORS +1 -1
  6. data/Documentation/.gitignore +5 -0
  7. data/Documentation/GNUmakefile +30 -0
  8. data/Documentation/unicorn.1.txt +158 -0
  9. data/Documentation/unicorn_rails.1.txt +150 -0
  10. data/GIT-VERSION-GEN +40 -0
  11. data/GNUmakefile +102 -14
  12. data/README +3 -2
  13. data/Rakefile +104 -32
  14. data/SIGNALS +2 -4
  15. data/TODO +3 -9
  16. data/bin/unicorn +5 -2
  17. data/bin/unicorn_rails +5 -3
  18. data/ext/unicorn_http/c_util.h +2 -2
  19. data/ext/unicorn_http/common_field_optimization.h +2 -1
  20. data/ext/unicorn_http/ext_help.h +29 -4
  21. data/ext/unicorn_http/extconf.rb +5 -0
  22. data/ext/unicorn_http/unicorn_http.rl +131 -76
  23. data/lib/unicorn.rb +6 -2
  24. data/lib/unicorn/app/exec_cgi.rb +3 -1
  25. data/lib/unicorn/app/inetd.rb +2 -0
  26. data/lib/unicorn/app/old_rails.rb +2 -0
  27. data/lib/unicorn/app/old_rails/static.rb +3 -1
  28. data/lib/unicorn/cgi_wrapper.rb +3 -1
  29. data/lib/unicorn/configurator.rb +2 -0
  30. data/lib/unicorn/const.rb +8 -6
  31. data/lib/unicorn/http_request.rb +6 -5
  32. data/lib/unicorn/http_response.rb +4 -2
  33. data/lib/unicorn/launcher.rb +6 -0
  34. data/lib/unicorn/socket_helper.rb +5 -5
  35. data/lib/unicorn/tee_input.rb +2 -0
  36. data/lib/unicorn/util.rb +2 -0
  37. data/local.mk.sample +4 -2
  38. data/setup.rb +1 -0
  39. data/test/aggregate.rb +2 -0
  40. data/test/exec/test_exec.rb +157 -0
  41. data/test/rails/app-1.2.3/app/controllers/application.rb +2 -0
  42. data/test/rails/app-1.2.3/app/controllers/foo_controller.rb +2 -0
  43. data/test/rails/app-1.2.3/app/helpers/application_helper.rb +2 -0
  44. data/test/rails/app-1.2.3/config/boot.rb +2 -0
  45. data/test/rails/app-1.2.3/config/environment.rb +2 -0
  46. data/test/rails/app-1.2.3/config/environments/development.rb +2 -0
  47. data/test/rails/app-1.2.3/config/environments/production.rb +2 -0
  48. data/test/rails/app-1.2.3/config/routes.rb +2 -0
  49. data/test/rails/app-2.0.2/app/controllers/application.rb +2 -0
  50. data/test/rails/app-2.0.2/app/controllers/foo_controller.rb +2 -0
  51. data/test/rails/app-2.0.2/app/helpers/application_helper.rb +2 -0
  52. data/test/rails/app-2.0.2/config/boot.rb +2 -0
  53. data/test/rails/app-2.0.2/config/environment.rb +2 -0
  54. data/test/rails/app-2.0.2/config/environments/development.rb +2 -0
  55. data/test/rails/app-2.0.2/config/environments/production.rb +2 -0
  56. data/test/rails/app-2.0.2/config/routes.rb +2 -0
  57. data/test/rails/app-2.1.2/app/controllers/application.rb +2 -0
  58. data/test/rails/app-2.1.2/app/controllers/foo_controller.rb +2 -0
  59. data/test/rails/app-2.1.2/app/helpers/application_helper.rb +2 -0
  60. data/test/rails/app-2.1.2/config/boot.rb +2 -0
  61. data/test/rails/app-2.1.2/config/environment.rb +2 -0
  62. data/test/rails/app-2.1.2/config/environments/development.rb +2 -0
  63. data/test/rails/app-2.1.2/config/environments/production.rb +2 -0
  64. data/test/rails/app-2.1.2/config/routes.rb +2 -0
  65. data/test/rails/app-2.2.2/app/controllers/application.rb +2 -0
  66. data/test/rails/app-2.2.2/app/controllers/foo_controller.rb +2 -0
  67. data/test/rails/app-2.2.2/app/helpers/application_helper.rb +2 -0
  68. data/test/rails/app-2.2.2/config/boot.rb +2 -0
  69. data/test/rails/app-2.2.2/config/environment.rb +2 -0
  70. data/test/rails/app-2.2.2/config/environments/development.rb +2 -0
  71. data/test/rails/app-2.2.2/config/environments/production.rb +2 -0
  72. data/test/rails/app-2.2.2/config/routes.rb +2 -0
  73. data/test/rails/app-2.3.3.1/app/controllers/application_controller.rb +2 -0
  74. data/test/rails/app-2.3.3.1/app/controllers/foo_controller.rb +2 -0
  75. data/test/rails/app-2.3.3.1/app/helpers/application_helper.rb +2 -0
  76. data/test/rails/app-2.3.3.1/config/boot.rb +2 -0
  77. data/test/rails/app-2.3.3.1/config/environment.rb +2 -0
  78. data/test/rails/app-2.3.3.1/config/environments/development.rb +2 -0
  79. data/test/rails/app-2.3.3.1/config/environments/production.rb +2 -0
  80. data/test/rails/app-2.3.3.1/config/routes.rb +2 -0
  81. data/test/rails/test_rails.rb +2 -0
  82. data/test/test_helper.rb +8 -0
  83. data/test/unit/test_configurator.rb +2 -0
  84. data/test/unit/test_http_parser.rb +13 -0
  85. data/test/unit/test_http_parser_ng.rb +2 -0
  86. data/test/unit/test_request.rb +2 -0
  87. data/test/unit/test_response.rb +2 -0
  88. data/test/unit/test_server.rb +2 -0
  89. data/test/unit/test_signals.rb +2 -0
  90. data/test/unit/test_socket_helper.rb +2 -0
  91. data/test/unit/test_tee_input.rb +2 -1
  92. data/test/unit/test_upload.rb +2 -0
  93. data/test/unit/test_util.rb +2 -0
  94. data/unicorn.gemspec +38 -28
  95. metadata +38 -42
  96. data/Manifest +0 -137
File without changes
data/.document CHANGED
@@ -6,5 +6,9 @@ CONTRIBUTORS
6
6
  LICENSE
7
7
  SIGNALS
8
8
  TODO
9
+ NEWS
10
+ ChangeLog
9
11
  lib
10
12
  ext/unicorn_http/unicorn_http.c
13
+ unicorn.1
14
+ unicorn_rails.1
data/.gitignore CHANGED
@@ -12,3 +12,8 @@ ext/unicorn_http/unicorn_http.c
12
12
  log/
13
13
  pkg/
14
14
  /vendor
15
+ /NEWS
16
+ /ChangeLog
17
+ /.manifest
18
+ /GIT-VERSION-FILE
19
+ /man
@@ -0,0 +1,26 @@
1
+ # This list is used by "git shortlog" to fixup the ugly faux email addresses
2
+ # "<username@UGLY-UUID>" that the "git svn" tool creates by default.
3
+
4
+ # Eric Wong started this .mailmap file (and is the maintainer of it...)
5
+ Eric Wong <normalperson@yhbt.net> normalperson <normalperson@19e92222-5c0b-0410-8929-a290d50e31e9>
6
+
7
+ # This also includes all the Mongrel contributors that committed to the
8
+ # Rubyforge SVN repo. Some real names were looked up on rubyforge.org
9
+ # (http://rubyforge.org/users/$user), but we're not going expose any email
10
+ # addresses here without their permission.
11
+
12
+ Austin Godber godber <godber> godber <godber@19e92222-5c0b-0410-8929-a290d50e31e9>
13
+ Bradley Taylor <bktaylor> bktaylor <bktaylor@19e92222-5c0b-0410-8929-a290d50e31e9>
14
+ Ezra Zygmuntowicz <ezmobius> ezmobius <ezmobius@19e92222-5c0b-0410-8929-a290d50e31e9>
15
+ Filipe Lautert <filipe> filipe <filipe@19e92222-5c0b-0410-8929-a290d50e31e9>
16
+ Luis Lavena <luislavena> luislavena <luislavena@19e92222-5c0b-0410-8929-a290d50e31e9>
17
+ Matt Pelletier <bricolage> bricolage <bricolage@19e92222-5c0b-0410-8929-a290d50e31e9>
18
+ MenTaLguY <mental> mental <mental@19e92222-5c0b-0410-8929-a290d50e31e9>
19
+ Nick Sieger <nicksieger> nicksieger <nicksieger@19e92222-5c0b-0410-8929-a290d50e31e9>
20
+ Rick Olson <technoweenie> technoweenie <technoweenie@19e92222-5c0b-0410-8929-a290d50e31e9>
21
+ Wayne E. Seguin <wayneeseguin> wayneeseguin <wayneeseguin@19e92222-5c0b-0410-8929-a290d50e31e9>
22
+ Zed A. Shaw <zedshaw> <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>
23
+ why the lucky stiff <whytheluckystiff> <why@19e92222-5c0b-0410-8929-a290d50e31e9>
24
+
25
+ # Evan had his email address in the git history we branched from anyways
26
+ Evan Weaver <eweaver@twitter.com> evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>
@@ -14,7 +14,7 @@ The original Mongrel contributors:
14
14
 
15
15
  * Luis Lavena
16
16
  * Wilson Bilkovich
17
- * Why the Lucky Stiff
17
+ * why the lucky stiff
18
18
  * Dan Kubb
19
19
  * MenTaLguY
20
20
  * Filipe Lautert
@@ -0,0 +1,5 @@
1
+ *.1
2
+ *.5
3
+ *.7
4
+ *.gz
5
+ *.html
@@ -0,0 +1,30 @@
1
+ all::
2
+
3
+ PANDOC = pandoc
4
+ PANDOC_OPTS = -f markdown --email-obfuscation=none --sanitize-html
5
+ pandoc = $(PANDOC) $(PANDOC_OPTS)
6
+ pandoc_html = $(pandoc) --toc -t html --no-wrap
7
+
8
+ man1 := $(addsuffix .1,unicorn unicorn_rails)
9
+ html1 := $(addsuffix .html,$(man1))
10
+
11
+ all:: html man
12
+
13
+ html: $(html1)
14
+ man: $(man1)
15
+
16
+ install-html: html
17
+ mkdir -p ../doc/man1
18
+ install -m 644 $(html1) ../doc/man1
19
+
20
+ install-man: man
21
+ mkdir -p ../man/man1
22
+ install -m 644 $(man1) ../man/man1
23
+
24
+ %.1: %.1.txt
25
+ $(pandoc) -s -t man < $< > $@+ && mv $@+ $@
26
+ %.1.html: %.1.txt
27
+ $(pandoc_html) < $< > $@+ && mv $@+ $@
28
+
29
+ clean::
30
+ $(RM) $(man1) $(html1)
@@ -0,0 +1,158 @@
1
+ % UNICORN(1) Unicorn User Manual
2
+ % The Unicorn Community <mongrel-unicorn@rubyforge.org>
3
+ % September 15, 2009
4
+
5
+ # NAME
6
+
7
+ unicorn - a rackup-like command to launch the Unicorn HTTP server
8
+
9
+ # SYNOPSIS
10
+
11
+ unicorn [-c CONFIG_FILE] [-E RACK_ENV] [-D] [RACKUP_FILE]
12
+
13
+ # DESCRIPTION
14
+
15
+ A rackup(1)-like command to launch Rack applications using Unicorn.
16
+ It is expected to be started in your application root (APP_ROOT), but
17
+ "Dir.chdir" may also be executed in the CONFIG_FILE or RACKUP_FILE.
18
+
19
+ While Unicorn takes a myriad of command-line options for
20
+ compatibility with ruby(1) and rackup(1), it is recommended to stick
21
+ to the few command-line options specified in the SYNOPSIS and use
22
+ the CONFIG_FILE as much as possible.
23
+
24
+ # RACKUP FILE
25
+
26
+ This defaults to \"config.ru\" in APP_ROOT. It should be the same
27
+ file used by rackup(1) and other Rack launchers, it uses the
28
+ *Rack::Builder* DSL.
29
+
30
+ Embedded command-line options are mostly parsed for compatibility
31
+ with rackup(1) but strongly discouraged.
32
+
33
+ # UNICORN OPTIONS
34
+ -c, \--config-file CONFIG_FILE
35
+ : Path to the Unicorn-specific config file. The config file is
36
+ implemented as a Ruby DSL, so Ruby code may executed (e.g.
37
+ "Dir.chdir", "Process::UID.change_privilege"). See the RDoc/ri
38
+ for the *Unicorn::Configurator* class for the full list of
39
+ directives available from the DSL.
40
+
41
+ -D, \--daemonize
42
+ : Run daemonized in the background. The process is detached from
43
+ the controlling terminal and stdin is redirected to "/dev/null".
44
+ Unlike many common UNIX daemons, we do not chdir to \"/\"
45
+ upon daemonization to allow more control over the startup/upgrade
46
+ process.
47
+ Unless specified in the CONFIG_FILE, stderr and stdout will
48
+ also be redirected to "/dev/null".
49
+
50
+ -E, \--env RACK_ENV
51
+ : Run under the given RACK_ENV. See the RACK ENVIRONMENT section
52
+ for more details.
53
+
54
+ -l, \--listen ADDRESS
55
+ : Listens on a given ADDRESS. ADDRESS may be in the form of
56
+ HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
57
+ and PATH is meant to be a path to a UNIX domain socket.
58
+ Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080)
59
+ For production deployments, specifying the "listen" directive in
60
+ CONFIG_FILE is recommended as it allows fine-tuning of socket
61
+ options.
62
+
63
+ # RACKUP COMPATIBILITY OPTIONS
64
+ -o, \--host HOST
65
+ : Listen on a TCP socket belonging to HOST, default is
66
+ "0.0.0.0" (all addresses).
67
+ If specified multiple times on the command-line, only the
68
+ last-specified value takes effect.
69
+ This option only exists for compatibility with the rackup(1) command,
70
+ use of "-l"/"\--listen" switch is recommended instead.
71
+
72
+ -p, \--port PORT
73
+ : Listen on the specified TCP PORT, default is 8080.
74
+ If specified multiple times on the command-line, only the last-specified
75
+ value takes effect.
76
+ This option only exists for compatibility with the rackup(1) command,
77
+ use of "-l"/"\--listen" switch is recommended instead.
78
+
79
+ -s, \--server SERVER
80
+ : No-op, this exists only for compatibility with rackup(1).
81
+
82
+ # RUBY OPTIONS
83
+ -e, \--eval LINE
84
+ : Evaluate a LINE of Ruby code. This evaluation happens
85
+ immediately as the command-line is being parsed.
86
+
87
+ -d, \--debug
88
+ : Turn on debug mode, the $DEBUG variable is set to true.
89
+
90
+ -w, \--warn
91
+ : Turn on verbose warnings, the $VERBOSE variable is set to true.
92
+
93
+ -I, \--include PATH
94
+ : specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
95
+ The \':\' character may be used to delimit multiple directories.
96
+ This directive may be used more than once. Modifications to
97
+ $LOAD_PATH take place immediately and in the order they were
98
+ specified on the command-line.
99
+
100
+ -r, \--require LIBRARY
101
+ : require a specified LIBRARY before executing the application. The
102
+ \"require\" statement will be executed immediately and in the order
103
+ they were specified on the command-line.
104
+
105
+ # SIGNALS
106
+
107
+ The following UNIX signals may be sent to the master process:
108
+
109
+ * HUP - reload config file, app, and gracefully restart all workers
110
+ * INT/TERM - quick shutdown, kills all workers immediately
111
+ * QUIT - graceful shutdown, waits for workers to finish their
112
+ current request before finishing.
113
+ * USR1 - reopen all logs owned by the master and all workers
114
+ See Unicorn::Util.reopen_logs for what is considered a log.
115
+ * USR2 - reexecute the running binary. A separate QUIT
116
+ should be sent to the original process once the child is verified to
117
+ be up and running.
118
+ * WINCH - gracefully stops workers but keep the master running.
119
+ This will only work for daemonized processes.
120
+ * TTIN - increment the number of worker processes by one
121
+ * TTOU - decrement the number of worker processes by one
122
+
123
+ See the [SIGNALS][4] document for full description of all signals
124
+ used by Unicorn.
125
+
126
+ # RACK ENVIRONMENT
127
+
128
+ Accepted values of RACK_ENV and the middleware they automatically load
129
+ (outside of RACKUP_FILE) are exactly as those in rackup(1):
130
+
131
+ * development - loads Rack::CommonLogger, Rack::ShowExceptions, and
132
+ Rack::Lint middleware
133
+ * deployment - loads Rack::CommonLogger middleware
134
+ * none - loads no middleware at all, relying
135
+ entirely on RACKUP_FILE
136
+
137
+ All unrecognized values for RACK_ENV are assumed to be
138
+ "none". Production deployments are strongly encouraged to use
139
+ "deployment" or "none" for maximum performance.
140
+
141
+ Note that the Rack::ContentLength and Rack::Chunked middlewares
142
+ are never loaded by default. If needed, they should be
143
+ individually specified in the RACKUP_FILE, some frameworks do
144
+ not require them.
145
+
146
+ # SEE ALSO
147
+
148
+ * unicorn_rails(1)
149
+ * *Rack::Builder* ri/RDoc
150
+ * *Unicorn::Configurator* ri/RDoc
151
+ * [Unicorn RDoc][1]
152
+ * [Rack RDoc][2]
153
+ * [Rackup HowTo][3]
154
+
155
+ [1]: http://unicorn.bogomips.org/
156
+ [2]: http://rack.rubyforge.org/doc/
157
+ [3]: http://wiki.github.com/rack/rack/tutorial-rackup-howto
158
+ [4]: http://unicorn.bogomips.org/SIGNALS.html
@@ -0,0 +1,150 @@
1
+ % UNICORN_RAILS(1) Unicorn User Manual
2
+ % The Unicorn Community <mongrel-unicorn@rubyforge.org>
3
+ % September 17, 2009
4
+
5
+ # NAME
6
+
7
+ unicorn_rails - a rackup-like command to launch the Unicorn HTTP server
8
+
9
+ # SYNOPSIS
10
+
11
+ unicorn_rails [-c CONFIG_FILE] [-E RAILS_ENV] [-D] [RACKUP_FILE]
12
+
13
+ # DESCRIPTION
14
+
15
+ A rackup(1)-like command to launch Rails applications using Unicorn. It
16
+ is expected to be started in your Rails application root (RAILS_ROOT),
17
+ but "Dir.chdir" may also be executed in the CONFIG_FILE or
18
+ optionally, RACKUP_FILE.
19
+
20
+ The outward interface resembles rackup(1), the internals and default
21
+ middleware loading is designed like the `script/server` command
22
+ distributed with Rails.
23
+
24
+ While Unicorn takes a myriad of command-line options for compatibility
25
+ with ruby(1) and rackup(1), it is recommended to stick to the few
26
+ command-line options specified in the SYNOPSIS and use the CONFIG_FILE
27
+ as much as possible.
28
+
29
+ # UNICORN OPTIONS
30
+ -c, \--config-file CONFIG_FILE
31
+ : Path to the Unicorn-specific config file. The config file is
32
+ implemented as a Ruby DSL, so Ruby code may executed (e.g.
33
+ "Dir.chdir", "Process::UID.change_privilege"). See the RDoc/ri
34
+ for the *Unicorn::Configurator* class for the full list of
35
+ directives available from the DSL.
36
+
37
+ -D, \--daemonize
38
+ : Run daemonized in the background. The process is detached from
39
+ the controlling terminal and stdin is redirected to "/dev/null".
40
+ Unlike many common UNIX daemons, we do not chdir to \"/\"
41
+ upon daemonization to allow more control over the startup/upgrade
42
+ process.
43
+ Unless specified in the CONFIG_FILE, stderr and stdout will
44
+ also be redirected to "/dev/null".
45
+ Daemonization will _skip_ loading of the *Rails::Rack::LogTailer*
46
+ middleware under Rails \>\= 2.3.x.
47
+ By default, unicorn\_rails(1) will create a PID file in
48
+ _\"RAILS\_ROOT/tmp/pids/unicorn.pid\"_. You may override this
49
+ by specifying the "pid" directive to override this Unicorn config file.
50
+
51
+ -E, \--env RAILS_ENV
52
+ : Run under the given RAILS_ENV. This sets the RAILS_ENV environment
53
+ variable. Acceptable values are exactly those you expect in your Rails
54
+ application, typically "development" or "production".
55
+
56
+ -l, \--listen ADDRESS
57
+ : Listens on a given ADDRESS. ADDRESS may be in the form of
58
+ HOST:PORT or PATH, HOST:PORT is taken to mean a TCP socket
59
+ and PATH is meant to be a path to a UNIX domain socket.
60
+ Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080).
61
+ For production deployments, specifying the "listen" directive in
62
+ CONFIG_FILE is recommended as it allows fine-tuning of socket
63
+ options.
64
+
65
+ # RACKUP COMPATIBILITY OPTIONS
66
+ -o, \--host HOST
67
+ : Listen on a TCP socket belonging to HOST, default is
68
+ "0.0.0.0" (all addresses).
69
+ If specified multiple times on the command-line, only the
70
+ last-specified value takes effect.
71
+ This option only exists for compatibility with the rackup(1) command,
72
+ use of "-l"/"\--listen" switch is recommended instead.
73
+
74
+ -p, \--port PORT
75
+ : Listen on the specified TCP PORT, default is 8080.
76
+ If specified multiple times on the command-line, only the last-specified
77
+ value takes effect.
78
+ This option only exists for compatibility with the rackup(1) command,
79
+ use of "-l"/"\--listen" switch is recommended instead.
80
+
81
+ # RUBY OPTIONS
82
+ -e, \--eval LINE
83
+ : Evaluate a LINE of Ruby code. This evaluation happens
84
+ immediately as the command-line is being parsed.
85
+
86
+ -d, \--debug
87
+ : Turn on debug mode, the $DEBUG variable is set to true.
88
+ For Rails \>\= 2.3.x, this loads the *Rails::Rack::Debugger*
89
+ middleware.
90
+
91
+ -w, \--warn
92
+ : Turn on verbose warnings, the $VERBOSE variable is set to true.
93
+
94
+ -I, \--include PATH
95
+ : specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH.
96
+ The \':\' character may be used to delimit multiple directories.
97
+ This directive may be used more than once. Modifications to
98
+ $LOAD_PATH take place immediately and in the order they were
99
+ specified on the command-line.
100
+
101
+ -r, \--require LIBRARY
102
+ : require a specified LIBRARY before executing the application. The
103
+ \"require\" statement will be executed immediately and in the order
104
+ they were specified on the command-line.
105
+
106
+ # RACKUP FILE
107
+
108
+ This defaults to \"config.ru\" in RAILS_ROOT. It should be the same
109
+ file used by rackup(1) and other Rack launchers, it uses the
110
+ *Rack::Builder* DSL. Unlike many other Rack applications, RACKUP_FILE
111
+ is completely _optional_ for Rails, but may be used to disable some
112
+ of the default middleware for performance.
113
+
114
+ Embedded command-line options are mostly parsed for compatibility
115
+ with rackup(1) but strongly discouraged.
116
+
117
+ # SIGNALS
118
+
119
+ The following UNIX signals may be sent to the master process:
120
+
121
+ * HUP - reload config file, app, and gracefully restart all workers
122
+ * INT/TERM - quick shutdown, kills all workers immediately
123
+ * QUIT - graceful shutdown, waits for workers to finish their
124
+ current request before finishing.
125
+ * USR1 - reopen all logs owned by the master and all workers
126
+ See Unicorn::Util.reopen_logs for what is considered a log.
127
+ * USR2 - reexecute the running binary. A separate QUIT
128
+ should be sent to the original process once the child is verified to
129
+ be up and running.
130
+ * WINCH - gracefully stops workers but keep the master running.
131
+ This will only work for daemonized processes.
132
+ * TTIN - increment the number of worker processes by one
133
+ * TTOU - decrement the number of worker processes by one
134
+
135
+ See the [SIGNALS][4] document for full description of all signals
136
+ used by Unicorn.
137
+
138
+ # SEE ALSO
139
+
140
+ * unicorn(1)
141
+ * *Rack::Builder* ri/RDoc
142
+ * *Unicorn::Configurator* ri/RDoc
143
+ * [Unicorn RDoc][1]
144
+ * [Rack RDoc][2]
145
+ * [Rackup HowTo][3]
146
+
147
+ [1]: http://unicorn.bogomips.org/
148
+ [2]: http://rack.rubyforge.org/doc/
149
+ [3]: http://wiki.github.com/rack/rack/tutorial-rackup-howto
150
+ [4]: http://unicorn.bogomips.org/SIGNALS.html
@@ -0,0 +1,40 @@
1
+ #!/bin/sh
2
+
3
+ GVF=GIT-VERSION-FILE
4
+ DEF_VER=v0.92.0.GIT
5
+
6
+ LF='
7
+ '
8
+
9
+ # First see if there is a version file (included in release tarballs),
10
+ # then try git-describe, then default.
11
+ if test -f version
12
+ then
13
+ VN=$(cat version) || VN="$DEF_VER"
14
+ elif test -d .git -o -f .git &&
15
+ VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
16
+ case "$VN" in
17
+ *$LF*) (exit 1) ;;
18
+ v[0-9]*)
19
+ git update-index -q --refresh
20
+ test -z "$(git diff-index --name-only HEAD --)" ||
21
+ VN="$VN-dirty" ;;
22
+ esac
23
+ then
24
+ VN=$(echo "$VN" | sed -e 's/-/./g');
25
+ else
26
+ VN="$DEF_VER"
27
+ fi
28
+
29
+ VN=$(expr "$VN" : v*'\(.*\)')
30
+
31
+ if test -r $GVF
32
+ then
33
+ VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
34
+ else
35
+ VC=unset
36
+ fi
37
+ test "$VN" = "$VC" || {
38
+ echo >&2 "GIT_VERSION = $VN"
39
+ echo "GIT_VERSION = $VN" >$GVF
40
+ }