3 public-inbox-daemon - common usage for public-inbox network daemons
13 This manual describes common options and behavior for
14 public-inbox network daemons. Network daemons for public-inbox
15 provide read-only NNTP, IMAP and HTTP access to public-inboxes. Write
16 access to a public-inbox will never be required to run these.
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.
34 =item --listen ADDRESS
36 This takes an absolute path to a Unix socket or HOST:PORT
37 to listen on. For example, to listen to TCP connections on
38 port 119, use: C<-l 0.0.0.0:119>. This may also point to
39 a Unix socket (C<-l /path/to/http.sock>) for a reverse proxy
40 like L<nginx(8)> to use.
42 May be specified multiple times to allow listening on multiple
45 This does not need to be specified at all if relying on
46 L<systemd.socket(5)> or similar
48 Default: server-dependent unless socket activation is used with
49 L<systemd(1)> or similar (see L<systemd.socket(5)>).
55 Specify an appendable path to redirect stdout descriptor (1) to.
56 Using this is preferable to setting up the redirect externally
57 (e.g. E<gt>E<gt>/path/to/log in shell) since it allows
58 SIGUSR1 to be handled (see L<SIGNALS/SIGNALS> below).
66 Like C<--stdout>, but for the stderr descriptor (2).
70 =item --worker-processes
72 Set the number of worker processes.
74 Normally, this should match the number of CPUs on the system to
75 take full advantage of the hardware. However, users of
76 memory-constrained systems may want to lower this.
78 Setting this to zero (C<-W0>) disables the master/worker split;
79 saving some memory but removing the ability to use SIGTTIN
80 to increase worker processes or have the worker restarted by
81 the master on crashes.
89 Most of our signal handling behavior is copied from L<nginx(8)>
90 and/or L<starman(1)>; so it is possible to reuse common scripts
97 Reopens log files pointed to by --stdout and --stderr options.
101 Spawn a new process with the intention to replace the running one.
102 See L</UPGRADING> below.
106 Reload config files associated with the process.
107 (Note: broken for L<public-inbox-httpd(1)> only in E<lt>= 1.6)
111 Increase the number of running workers processes by one.
115 Decrease the number of running worker processes by one.
119 Stop all running worker processes. SIGHUP or SIGTTIN
120 may be used to restart workers.
124 Gracefully terminate the running process.
128 SIGTTOU, SIGTTIN, SIGWINCH all have no effect when worker
129 processes are disabled with C<-W0> on the command-line.
137 The default config file, normally "~/.public-inbox/config".
138 See L<public-inbox-config(5)>
140 =item LISTEN_FDS, LISTEN_PID
142 Used by systemd (and compatible) installations for socket
143 activation. See L<systemd.socket(5)> and L<sd_listen_fds(3)>.
145 =item PERL_INLINE_DIRECTORY
147 Pointing this to point to a writable directory enables the use
148 of L<Inline> and L<Inline::C> extensions which may provide
149 platform-specific performance improvements. Currently, this
150 enables the use of L<vfork(2)> which speeds up subprocess
151 spawning with the Linux kernel.
153 public-inbox will never enable L<Inline::C> automatically without
154 this environment variable set or C<~/.cache/public-inbox/inline-c>
155 created by a user. See L<Inline> and L<Inline::C> for more details.
161 There are two ways to upgrade a running process.
163 Users of process management systems with socket activation
164 (L<systemd(1)> or similar) may rely on multiple instances For
165 systemd, this means using two (or more) '@' instances for each
166 service (e.g. C<SERVICENAME@INSTANCE>) as documented in
169 Users of traditional SysV init may use SIGUSR2 to spawn
170 a replacement process and gracefully terminate the old
171 process using SIGQUIT.
173 In either case, the old process will not truncate running
174 responses; so responses to expensive requests do not get
175 interrupted and lost.
179 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
181 The mail archives are hosted at L<https://public-inbox.org/meta/> and
182 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
186 Copyright 2013-2021 all contributors L<mailto:meta@public-inbox.org>
188 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
192 L<public-inbox-httpd(1)>, L<public-inbox-imapd(1)>,
193 L<public-inbox-nntpd(1)>