Commit Graph
2 Commits
Author SHA1 Message Date
Vladimir Dubrovin eec09dc4e9 port: a reservation kept only while the configuration in force has it
Once reserved, a port is dropped when a configuration comes in force
that neither reserves it anew nor has a service on it: after chroot no
reservation can be made again, only the usage of the socket a service
takes over keeps it. The reservation of the configuration before no
longer waits for its last client to let it go: the reload releases it
at once, the socket living on where a service of the new one has
claimed it, closing where none has.
2026-11-21 16:17:35 +03:00
Vladimir Dubrovin 17306f63f9 port: a listening socket reserved while the configuration is read
port tcp|udp [ip:]port [socket_options] opens, binds and listens at
the time the line is read, so a privileged port can be taken before
setuid and chroot drop the rights to open it: a service of the
configuration on the same address, of the same type, takes the socket
over when it starts, instead of binding one of its own, and a port no
service takes stays reserved until the configuration is left. A
reservation of the configuration before holds the port over a reload:
the new one shares its socket, each dropping its hold with its
configuration.

The socket is what the reservation made of it: the options which act
only before bind() cannot follow a service's wishes on a socket already
bound, so the service takes it as it is, its other options set on it.
The reservation is built from the same default address a service is, so
it matches in every byte a listener is compared by.
2026-11-21 16:12:40 +03:00