On Fri, Jan 06, 2023 at 03:28:23PM -0500, Wietse Venema wrote:

> > The documentation of inet_interfaces says otherwise, my recollection is
> > that master(8) does not attempt to rebind inet sockets on "reload":
> 
> I see. Yes, that could be dififcult. Or maybe not. 
> 
> The Postfix master creates as many sockets as needed for an inet
> service, and sets the socket option SO_REUSEADDR on each socket,
> and bind()s them to the desired addresses.
> 
> With that, it may be possible for the Postfix master to create new
> sockets, set SO_REUSEADDR on each socket, and bind() them to the
> new addresses; if successful, close() the old sockets, otherwise
> close() the new sockets.

Yes, typically doable, by determining which bindings are unchanged,
which new, and which old.

> Am I missing something? This will have to work on all supported
> systems, though. Not just Linux, not just *BSD.

The tricky case is changing a wildcard binding to a set of non-wildcard
bindings.  When a wildcard binding is active, it is AFAIK not generally
possible to bind non-wildcard listeners for the same port, and
presumably the converse.

Changes in explicit lists of IPs should be viable as you noted.

-- 
    Viktor.

Reply via email to