yahns Ruby server user/dev discussion
 help / color / Atom feed
efdfb6dc46e55437c0e676c34904cfefd3634d10 blob 5310 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
 
=head1 NAME

yahns-rackup - a rackup-like command to launch yahns

=head1 SYNOPSIS

yahns-rackup [-E RACK_ENV] [-O worker_threads=NUM] [RACKUP_FILE]

=head1 DESCRIPTION

A L<rackup(1)>-like command to launch Rack applications using yahns.
It is expected to start in your application root (APP_ROOT).

=head1 RACKUP FILE

This defaults to "config.ru" in APP_ROOT.  It should be the same
file used by L<rackup(1)> and other Rack launchers, it uses the
*Rack::Builder* DSL documented at:

L<http://www.rubydoc.info/github/rack/rack/Rack/Builder>

=head1 YAHNS OPTIONS

=over

=item -O client_timeout=SECONDS

Defines the timeout expiring idle connections.

Increase this if your application takes longer to run than the
default timeout.  Lower this if you run out of FDs.

Default: 15 (seconds)

=item -O listen=ADDRESS[,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:9292" (all addresses on TCP port 9292).
Multiple addresses may be separated with commas.

=item -O stderr_path=PATHNAME

Allow redirecting $stderr to a given path.  Unlike doing this from
the shell, this allows the yahns process to know the path its
writing to and rotate the file if it is used for logging.  The
file will be opened with the O_APPEND flag and writes
synchronized to the kernel (but not necessarily to _disk_) so
multiple processes can safely append to it.

If you are daemonizing and using the default logger, it is important
to specify this as errors will otherwise be lost to /dev/null.
Some applications/libraries may also triggering warnings that go to
stderr, and they will end up here.

Default: /dev/null if daemonized, controlling terminal if not

=item -O stdout_path=PATH

Same as stderr_path, except for $stdout.  Not many applications
write to $stdout, but any that do will have their output written here.
It is safe to point this to the same location a stderr_path.
Like stderr_path, this defaults to /dev/null when daemonized.

Default: /dev/null if daemonized, controlling terminal if not

=item -O worker_threads=INTEGER

This controls the number of threads for application processing.
Each queue has its own thread pool.  Increase this number if your
applications are able to use more threads effectively or if either
(or both) input/output buffering are disabled.  Lower this number if
you do not need multi-thread concurrency at all.

Default: 7

=back

=head1 RACKUP OPTIONS

=over

=item -D, --daemonize

Run daemonized in the background.  The process is detached from
the controlling terminal and stdin is redirected to /dev/null.
Unless specified via stderr_path and stdout_path, stderr and stdout will
also be redirected to "/dev/null".

=item -E, --env RACK_ENV

Run under the given RACK_ENV.  See the L</RACK ENVIRONMENT> section
for more details.

=item -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 L<rackup(1)> command,
use of "-l"/"--listen" switch is recommended instead.

=item -p, --port PORT

Listen on the specified TCP PORT, default is 9292.
If specified multiple times on the command-line, only the last-specified
value takes effect.
This option only exists for compatibility with the L<rackup(1)> command,
use of "-l"/"--listen" switch is recommended instead.

=back

=head1 RUBY OPTIONS

=over

=item -e, --eval LINE

Evaluate a LINE of Ruby code.  This evaluation happens
immediately as the command-line is being parsed.

=item -d, --debug

Turn on debug mode, the $DEBUG variable is set to true.

=item -w, --warn

Turn on verbose warnings, the $VERBOSE variable is set to true.

=item -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.

=item -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.

=back

=head1 SIGNALS

See L<yahns(1)>

=head1 FILES

See Rack documentation for a description of the rackup file format.

=head1 ENVIRONMENT VARIABLES

The RACK_ENV variable is set by the aforementioned -E switch.
If RACK_ENV is already set, it will be used unless -E is used.
See rackup documentation for more details.

=head1 CONTACT

All feedback welcome via plain-text mail to L<mailto:yahns-public@yhbt.net>
No subscription is necessary to post to the mailing list.
List archives are available at L<http://yhbt.net/yahns-public/>

=head1 COPYRIGHT

Copyright (C) 2013-2016 all contributors L<mailto:yahns-public@yhbt.net>
License: GPL-3.0+ L<http://www.gnu.org/licenses/gpl-3.0.txt>

=head1 SEE ALSO

L<yahns(1)>, L<yahns_config(5)>,
L<Rack::Builder RDoc|http://www.rubydoc.info/github/rack/rack/Rack/Builder>,
L<Rack RDoc|http://www.rubydoc.info/github/rack/rack/>,
L<Rackup HowTo|https://github.com/rack/rack/wiki/tutorial-rackup-howto>
debug log:

solving efdfb6d ...
found efdfb6d in https://yhbt.net/yahns.git

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox