3 public-inbox-daemon - common usage for public-inbox network daemons
12 This manual describes common options and behavior for
13 public-inbox network daemons. Network daemons for public-inbox
14 provide read-only NNTP and HTTP access to public-inboxes. Write
15 access to a public-inbox repository will never be required to
18 These daemons are implemented with a common core using
19 non-blocking sockets and optimized for fairness; even with
20 thousands of connected clients over slow links.
22 They also provide graceful shutdown/upgrade support to avoid
23 breaking existing connections during software upgrades.
25 These daemons may also utilize multiple pre-forked worker
26 processes to take advantage of multiple CPUs.
32 =item -l, --listen ADDRESS
34 This takes an absolute path to a Unix socket or HOST:PORT
35 to listen on. For example, to listen to TCP connections on
36 port 119, use: C<-l 0.0.0.0:119>. This may also point to
37 a Unix socket (C<-l /path/to/http.sock>) for a reverse proxy
38 like L<nginx(8)> to use.
40 May be specified multiple times to allow listening on multiple
43 This does not need to be specified at all if relying on
44 L<systemd.socket(5)> or similar
46 Default: server-dependent unless socket activation is used with
47 L<systemd(1)> or similar (see L<systemd.socket(5)>).
49 =item -1, --stdout PATH
51 Specify an appendable path to redirect stdout descriptor (1) to.
52 Using this is preferable to setting up the redirect externally
53 (e.g. E<gt>E<gt>/path/to/log in shell) since it allows
54 SIGUSR1 to be handled (see L<SIGNALS/SIGNALS> below).
58 =item -2, --stderr PATH
60 Like C<--stdout>, but for the stderr descriptor (2).
62 =item -W, --worker-processes
64 Set the number of worker processes.
66 Normally, this should match the number of CPUs on the system to
67 take full advantage of the hardware. However, users of
68 memory-constrained systems may want to lower this.
70 Setting this to zero (C<-W0>) disables the master/worker split;
71 saving some memory but removing the ability to use SIGTTIN
72 to increase worker processes or have the worker restarted by
73 the master on crashes.
81 Most of our signal handling behavior is copied from L<nginx(8)>
82 and/or L<starman(1)>; so it is possible to reuse common scripts
89 Reopens log files pointed to by --stdout and --stderr options.
93 Spawn a new process with the intention to replace the running one.
94 See L</UPGRADING> below.
98 Reload config files associated with the process.
99 (FIXME: not tested for -httpd, yet)
103 Increase the number of running workers processes by one.
107 Decrease the number of running worker processes by one.
111 Stop all running worker processes. SIGHUP or SIGTTIN
112 may be used to restart workers.
116 Gracefully terminate the running process.
120 SIGTTOU, SIGTTIN, SIGWINCH all have no effect when worker
121 processes are disabled with C<-W0> on the command-line.
129 The default config file, normally "~/.public-inbox/config".
130 See L<public-inbox-config(5)>
132 =item LISTEN_FDS, LISTEN_PID
134 Used by systemd (and compatible) installations for socket
135 activation. See L<systemd.socket(5)> and L<sd_listen_fds(3)>.
137 =item PERL_INLINE_DIRECTORY
139 Pointing this to point to a writable directory enables the use
140 of L<Inline> and L<Inline::C> extensions which may provide
141 platform-specific performance improvements. Currently, this
142 enables the use of L<vfork(2)> which speeds up subprocess
143 spawning with the Linux kernel.
145 public-inbox will never enable L<Inline::C> automatically without
146 this environment variable set. See L<Inline> and L<Inline::C>
153 There are two ways to upgrade a running process.
155 Users of process management systems with socket activation
156 (L<systemd(1)> or similar) may rely on multiple instances For
157 systemd, this means using two (or more) '@' instances for each
158 service (e.g. C<SERVICENAME@INSTANCE>) as documented in
161 Users of traditional SysV init may use SIGUSR2 to spawn
162 a replacement process and gracefully terminate the old
163 process using SIGQUIT.
165 In either case, the old process will not truncate running
166 responses; so responses to expensive requests do not get
167 interrupted and lost.
171 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
173 The mail archives are hosted at L<https://public-inbox.org/meta/>
174 and L<http://hjrcffqmbrq6wope.onion/meta/>
178 Copyright 2013-2019 all contributors L<mailto:meta@public-inbox.org>
180 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
184 L<public-inbox-httpd(1)>, L<public-inbox-nntpd(1)>