about summary refs log tree commit homepage
path: root/examples/unsubscribe-psgi@.service
DateCommit message (Collapse)
2019-06-30examples/*@.service: sockets MUST be NonBlocking
For users running multiple (-nntpd@1, -nntpd@2) instances of either -httpd or -nntpd via systemd to implement zero-downtime restarts; it's possible for a listen socket to become blocking for a moment during an accept syscall and cause a daemons to get stuck in a blocking accept() during PublicInbox::Listener::event_step (event_read in previous versions). Since O_NONBLOCK is a file description flag, systemd clearing O_NONBLOCK momentarily (before PublicInbox::Listener::new re-enables it) creates a window for another instance of our daemon to get stuck in accept(). cf. systemd.service(5)
2016-06-13doc: systemd examples should only kill one process
For our daemons, killing only the master process is enough. Killing the entire control group (as done by default in systemd) may cause subprocesses such as git to shut down unexpectedly. Having systemd kill workers directly will also cause an immediate shutdown since the master would've already signaled the workers; and workers will die after two shutdown requests.
2016-05-21examples/unsubscribe-psgi@.service: disable worker processes
This unsubscribe PSGI endpoint should never incur enough load to justify using multiple worker processes. If it's unstable and crashes, systemd can automatically restart it.
2016-05-20unsubscribe: get off mah lawn^H^H^Hist
While public-inbox is intended primarily for archival, SMTP list subscriptions are still in use in most places and users are likely to want a good unsubscribe mechanism. HTTP (or HTTPS) links in the List-Unsubscribe header are often preferable since some users may use an incorrect email address for mailto: links. Thus, it is useful to provide an example which generates an HTTPS link for users to click on. The default .psgi requires a POST confirmation (as destructive actions with GET are considered bad practice). However, the "confirm" parameter may be disabled for a true "one-click" unsubscribe. The generated URLs are hopefully short enough and both shell and highlighting-friendly to reduce copy+paste errors.