261021.11 · 8344fc7c6406507c34560f9a83e4e129a303fe5f
--persist keeps a tree served after reboot
www -p writes a .LOCK in place of a .lock. It holds no PID: the server records its PID in its registry directory instead, and a .LOCK is live while that server runs. A stopping server keeps every .LOCK and its registry link, and the next server on the address serves those trees again. --restart now also starts a server for an address whose persistent trees have none. Deleting the .LOCK ends the tree for good.
A user unit, shipped disabled by make install and the package, runs --restart at login. The package also ships a system template, www@.service, that does so from boot with the capability for port 80. Each unit stands aside while the other runs for the same user.
The package suggests graphviz, and its homepage keeps pointing at the repo's current name.
reading declarations
Changes to systemd/system@.service.in. All files
@@ -0,0 +1,20 @@+# The system template serves a user's .LOCK trees from boot, before login.+# Enable it for one user with: sudo systemctl enable @NAME@@<user>+# The capability lets it bind port 80, as the package's binary may.+# While the user unit runs in that user's session it serves the same+# trees, so this unit stands aside.+[Unit]+Description=@NAME@: serve %i's trees that .LOCK files name, from boot+Wants=network-online.target+After=network-online.target++[Service]+Type=oneshot+RemainAfterExit=yes+User=%i+AmbientCapabilities=CAP_NET_BIND_SERVICE+ExecCondition=/bin/sh -c '! XDG_RUNTIME_DIR=/run/user/$$(id -u) systemctl --user is-active --quiet @NAME@.service'+ExecStart=@BIN@ --restart++[Install]+WantedBy=multi-user.target