On 2024-12-12 20:25:35 +0300, Michael Tokarev wrote:
> 12.12.2024 20:03, Vincent Lefevre wrote:
> > On 2024-12-12 15:57:59 +0300, Michael Tokarev wrote:
> > > On Tue, 30 Apr 2024 16:33:14 +0200 Vincent Lefevre <vinc...@vinc17.net> 
> > > wrote:
> > > > I had to do "cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf".
> > > 
> > > Does it fix itself when you restart postfix?
> > 
> > No, it doesn't, because it seems that it is only
> > /etc/network/if-up.d/postfix that does the copy, while this script
> > is not involved when one restarts postfix.
> 
> When you restart postfix (either systemctl or /etc/init.d/), the
> startup procedure execute /usr/lib/postfix/configure-instance.sh,
> which updates whole chroot thing, not just resolv.conf.

I think that I was using

  postfix stop
  postfix start

(possibly because this is the way it was documented a long time ago,
and perhaps still in the upstream documentation):

# postfix stop
postfix/postfix-script: stopping the Postfix mail system
# postfix start
postfix/postfix-script: warning: /var/spool/postfix/etc/resolv.conf and 
/etc/resolv.conf differ
postfix/postfix-script: starting the Postfix mail system

and indeed, /var/spool/postfix/etc/resolv.conf has not been updated,
contrary to the use of "systemctl restart postfix".

But with the new postfix 3.9.1-4 version (I've just upgraded after
the above test), the problem with

  postfix stop
  postfix start

has apparently been solved:

# ls -l /etc/resolv.conf /var/spool/postfix/etc/resolv.conf
-rw-r--r-- 1 root root 94 2024-12-13 01:03:52 /etc/resolv.conf
-rw-r--r-- 1 root root 94 2024-12-13 01:04:03 /var/spool/postfix/etc/resolv.conf
# emacs /etc/resolv.conf
# ls -l /etc/resolv.conf /var/spool/postfix/etc/resolv.conf
-rw-r--r-- 1 root root 87 2024-12-13 01:12:48 /etc/resolv.conf
-rw-r--r-- 1 root root 94 2024-12-13 01:04:03 /var/spool/postfix/etc/resolv.conf
# postfix stop
postfix/postfix-script: stopping the Postfix mail system
# postfix start
431 blocks
postfix/postfix-script: starting the Postfix mail system
# ls -l /etc/resolv.conf /var/spool/postfix/etc/resolv.conf
-rw-r--r-- 1 root root 87 2024-12-13 01:12:48 /etc/resolv.conf
-rw-r--r-- 1 root root 87 2024-12-13 01:13:02 /var/spool/postfix/etc/resolv.conf

I suppose that this is the following in the 3.9.1-4 changelog:

  * run configure-instance.sh (for chroot) from within postfix-script,
    so every invocation of `postfix start' will run it, not just the
    startup scripts.  Add a patch to upstream postfix-script.
    This is to prepare for multiple instances mostly, and for consistency

Thanks.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to