rainbows(1)

πŸ“¦ version 5.0.0, in debian bookworm, ubuntu jammy, ubuntu noble

✨ rainbows(1) ✨

okay bestie, welcome to the rainbows(1) page from the General Commands Manual β€” she's giving classic UNIX manpage energy but make it cute, and we're gonna go through everything, no skipping, no cap πŸ’…


πŸŽ€ NAME πŸŽ€

rainbows β€” a rackup-like command to launch Rainbows!


🌸 SYNOPSIS 🌸

rainbows [-c CONFIG_FILE] [-E RACK_ENV] [-D] [RACKUP_FILE]

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, rainbows is a rackup(1)-like command that launches Rack applications using Rainbows!. You're expected to start it up in your application root (APP_ROOT), but lowkey you can also use the "working_directory" directive inside the CONFIG_FILE if you wanna be fancy.

Now, Rainbows! takes a myriad of command-line options for compatibility with ruby(1) and rackup(1) β€” like, so many β€” but here's the tea: it's recommended to stick to the few command-line options listed in the SYNOPSIS and use the CONFIG_FILE as much as possible. Periodt. πŸ‘‘


πŸ“ RACKUP FILE πŸ“

This defaults to "config.ru" in APP_ROOT. It should be the same file used by rackup(1) and other Rack launchers β€” it uses the Rack::Builder DSL, iykyk.

Embedded command-line options are mostly parsed for compatibility with rackup(1) but are strongly discouraged. Like, don't do it, bestie. πŸ™ˆ


πŸ’œ UNICORN OPTIONS πŸ’œ

  • -c, --config-file CONFIG_FILE β€” the path to the Unicorn-specific config file. This config file is implemented as a Ruby DSL, so Ruby code may be executed in it (yes, for real, so be careful who you trust πŸ’€). Check the RDoc/ri for the Unicorn::Configurator class for the full list of directives available from the DSL.
  • -D, --daemonize β€” run daemonized in the background. The process gets detached from the controlling terminal and stdin is redirected to "/dev/null". And unlike many common UNIX daemons, we do not chdir to "/" upon daemonization β€” that's so we get more control over the startup/upgrade process. Unless it's specified in the CONFIG_FILE, stderr and stdout will also be redirected to "/dev/null".
  • -E, --env RACK_ENV β€” run under the given RACK_ENV. Peep the RACK ENVIRONMENT section below for more deets.
  • -l, --listen ADDRESS β€” listens on a given ADDRESS. ADDRESS may be in the form of HOST:PORT or PATH β€” HOST:PORT is taken to mean a TCP socket, and PATH is meant to be a path to a UNIX domain socket. Defaults to "0.0.0.0:8080" (all addresses on TCP port 8080). For production deployments, specifying the "listen" directive in CONFIG_FILE is recommended since it allows fine-tuning of socket options. ✨
  • -N, --no-default-middleware β€” disables loading middleware implied by RACK_ENV. This bypasses the configuration documented in the RACK ENVIRONMENT section, but still allows RACK_ENV to be used for application/framework-specific purposes.

🌈 RACKUP COMPATIBILITY OPTIONS 🌈

  • -o, --host HOST β€” listen on a TCP socket belonging to HOST, default is "0.0.0.0" (all addresses). If specified multiple times on the command-line, only the last-specified value takes effect. This option only exists for compatibility with the rackup(1) command β€” use of the "-l"/"--listen" switch is recommended instead.
  • -p, --port PORT β€” listen on the specified TCP PORT, default is 8080. If specified multiple times on the command-line, only the last-specified value takes effect. This option only exists for compatibility with the rackup(1) command β€” use of the "-l"/"--listen" switch is recommended instead.
  • -s, --server SERVER β€” a no-op. This exists only for compatibility with rackup(1). That's it, that's the whole vibe. πŸ’€

⭐ RUBY OPTIONS ⭐

  • -e, --eval LINE β€” evaluate a LINE of Ruby code. This evaluation happens immediately as the command-line is being parsed.
  • -d, --debug β€” turn on debug mode, the $DEBUG variable is set to true.
  • -w, --warn β€” turn on verbose warnings, the $VERBOSE variable is set to true.
  • -I, --include PATH β€” specify $LOAD_PATH. PATH will be prepended to $LOAD_PATH. The ':' character may be used to delimit multiple directories. This directive may be used more than once. Modifications to $LOAD_PATH take place immediately and in the order they were specified on the command-line.
  • -r, --require LIBRARY β€” require a specified LIBRARY before executing the application. The "require" statement will be executed immediately and in the order they were specified on the command-line.

πŸ”₯ SIGNALS πŸ”₯

The following UNIX signals may be sent to the master process:

  • HUP β€” reload config file, app, and gracefully restart all workers
  • INT/TERM β€” quick shutdown, kills all workers immediately
  • QUIT β€” graceful shutdown, waits for workers to finish their current request before finishing.
  • USR1 β€” reopen all logs owned by the master and all workers. See Unicorn::Util.reopen_logs for what is considered a log.
  • USR2 β€” reexecute the running binary. A separate QUIT should be sent to the original process once the child is verified to be up and running.
  • WINCH β€” gracefully stops workers but keep the master running. This will only work for daemonized processes.
  • TTIN β€” increment the number of worker processes by one
  • TTOU β€” decrement the number of worker processes by one

See the SIGNALS (http://rainbows.bogomips.org/SIGNALS.html) document for full description of all signals used by Rainbows!.


🧚 RACK ENVIRONMENT 🧚

Accepted values of RACK_ENV and the middleware they automatically load (outside of RACKUP_FILE) are exactly as those in rackup(1):

  • development β€” loads Rack::CommonLogger, Rack::ShowExceptions, and Rack::Lint middleware
  • deployment β€” loads Rack::CommonLogger middleware
  • none β€” loads no middleware at all, relying entirely on RACKUP_FILE

All unrecognized values for RACK_ENV are assumed to be "none". Production deployments are strongly encouraged to use "deployment" or "none" for maximum performance. πŸš€

Note the Rack::ContentLength and Rack::Chunked middlewares are also loaded by "deployment" and "development", but no other values of RACK_ENV. If needed, they must be individually specified in the RACKUP_FILE β€” some frameworks do not require them.

🫢 SEE ALSO 🫢


πŸ‘‘ AUTHORS πŸ‘‘

Rainbows! Hackers <rainbows-public@bogomips.org>.


and that's the whole page, bestie πŸ’– this was the Rainbows! User Manual, dated December 3, 2009, and yes, it's still filed under rainbows(1) β€” go forth and slay your deployments ✨🌸

πŸ“¦ where this page comes from