diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/big_app_gc.rb | 3 | ||||
-rw-r--r-- | examples/echo.ru | 2 | ||||
-rw-r--r-- | examples/logger_mp_safe.rb | 1 | ||||
-rw-r--r-- | examples/logrotate.conf | 4 | ||||
-rw-r--r-- | examples/nginx.conf | 2 | ||||
-rw-r--r-- | examples/unicorn.conf.minimal.rb | 5 | ||||
-rw-r--r-- | examples/unicorn.conf.rb | 5 | ||||
-rw-r--r-- | examples/unicorn@.service | 7 |
8 files changed, 20 insertions, 9 deletions
diff --git a/examples/big_app_gc.rb b/examples/big_app_gc.rb index 9d05719..0baea26 100644 --- a/examples/big_app_gc.rb +++ b/examples/big_app_gc.rb @@ -1,2 +1,3 @@ -# see {Unicorn::OobGC}[https://bogomips.org/unicorn/Unicorn/OobGC.html] +# frozen_string_literal: false +# see {Unicorn::OobGC}[https://yhbt.net/unicorn/Unicorn/OobGC.html] # Unicorn::OobGC was broken in Unicorn v3.3.1 - v3.6.1 and fixed in v3.6.2 diff --git a/examples/echo.ru b/examples/echo.ru index 14908c5..453a5e6 100644 --- a/examples/echo.ru +++ b/examples/echo.ru @@ -1,4 +1,5 @@ #\-E none +# frozen_string_literal: false # # Example application that echoes read data back to the HTTP client. # This emulates the old echo protocol people used to run. @@ -19,7 +20,6 @@ class EchoBody < Struct.new(:input) end -use Rack::Chunked run lambda { |env| /\A100-continue\z/i =~ env['HTTP_EXPECT'] and return [100, {}, []] [ 200, { 'Content-Type' => 'application/octet-stream' }, diff --git a/examples/logger_mp_safe.rb b/examples/logger_mp_safe.rb index 05ad3fa..f2c0500 100644 --- a/examples/logger_mp_safe.rb +++ b/examples/logger_mp_safe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Multi-Processing-safe monkey patch for Logger # # This monkey patch fixes the case where "preload_app true" is used and diff --git a/examples/logrotate.conf b/examples/logrotate.conf index 77a01b5..c3aa40d 100644 --- a/examples/logrotate.conf +++ b/examples/logrotate.conf @@ -5,7 +5,7 @@ # https://linux.die.net/man/8/logrotate # # public logrotate-related discussion in our archives: -# https://bogomips.org/unicorn-public/?q=logrotate +# https://yhbt.net/unicorn-public/?q=logrotate # Modify the following glob to match the logfiles your app writes to: /var/log/unicorn_app/*.log { @@ -33,7 +33,7 @@ systemctl kill -s SIGUSR1 unicorn@2.service # Examples for other process management systems appreciated - # Mail us at unicorn-public@bogomips.org + # Mail us at unicorn-public@yhbt.net # (see above for archives) # If you use a pid file and assuming your pid file diff --git a/examples/nginx.conf b/examples/nginx.conf index b6b69c1..c5026f9 100644 --- a/examples/nginx.conf +++ b/examples/nginx.conf @@ -113,7 +113,7 @@ http { # try_files directive appeared in in nginx 0.7.27 and has stabilized # over time. Older versions of nginx (e.g. 0.6.x) requires # "if (!-f $request_filename)" which was less efficient: - # https://bogomips.org/unicorn.git/tree/examples/nginx.conf?id=v3.3.1#n127 + # https://yhbt.net/unicorn.git/tree/examples/nginx.conf?id=v3.3.1#n127 try_files $uri/index.html $uri.html $uri @app; location @app { diff --git a/examples/unicorn.conf.minimal.rb b/examples/unicorn.conf.minimal.rb index 2d1bf0a..4f96ede 100644 --- a/examples/unicorn.conf.minimal.rb +++ b/examples/unicorn.conf.minimal.rb @@ -1,9 +1,10 @@ +# frozen_string_literal: false # Minimal sample configuration file for Unicorn (not Rack) when used # with daemonization (unicorn -D) started in your working directory. # -# See https://bogomips.org/unicorn/Unicorn/Configurator.html for complete +# See https://yhbt.net/unicorn/Unicorn/Configurator.html for complete # documentation. -# See also https://bogomips.org/unicorn/examples/unicorn.conf.rb for +# See also https://yhbt.net/unicorn/examples/unicorn.conf.rb for # a more verbose configuration using more features. listen 2007 # by default Unicorn listens on port 8080 diff --git a/examples/unicorn.conf.rb b/examples/unicorn.conf.rb index d2897ef..5bae830 100644 --- a/examples/unicorn.conf.rb +++ b/examples/unicorn.conf.rb @@ -1,11 +1,12 @@ +# frozen_string_literal: false # Sample verbose configuration file for Unicorn (not Rack) # # This configuration file documents many features of Unicorn # that may not be needed for some applications. See -# https://bogomips.org/unicorn/examples/unicorn.conf.minimal.rb +# https://yhbt.net/unicorn/examples/unicorn.conf.minimal.rb # for a much simpler configuration file. # -# See https://bogomips.org/unicorn/Unicorn/Configurator.html for complete +# See https://yhbt.net/unicorn/Unicorn/Configurator.html for complete # documentation. # Use at least one worker per core if you're on a dedicated server, diff --git a/examples/unicorn@.service b/examples/unicorn@.service index d95eb83..946de44 100644 --- a/examples/unicorn@.service +++ b/examples/unicorn@.service @@ -14,7 +14,14 @@ After = unicorn.socket # bundler users must use the "--keep-file-descriptors" switch, here: # ExecStart = bundle exec --keep-file-descriptors unicorn -c ... ExecStart = /usr/bin/unicorn -c /path/to/unicorn.conf.rb /path/to/config.ru + +# NonBlocking MUST be true if using socket activation with unicorn. +# Otherwise, there's a small window in-between when the non-blocking +# flag is set by us and our accept4 call where systemd can momentarily +# make the socket blocking, causing us to block on accept4: +NonBlocking = true Sockets = unicorn.socket + KillSignal = SIGQUIT User = nobody Group = nogroup |