Postfix upgrade queries about replacing /etc/postfix/makedefs.out, when it really should always do so

Bug #1791853 reported by Keith Z-G
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postfix (Debian)
Fix Released
Unknown
postfix (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When upgrading Postfix, I was surprised to be asked

Configuration file '/etc/postfix/makedefs.out'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** makedefs.out (Y/I/N/O/D/Z) [default=N] ?

This would appear to have been added with version 3.1.4-1, specifically:

  * Install /etc/postfix/makedefs.out so users can see how the package was built

which is a laudable and understandable goal. However, it seems quite unequivocal that the package-provided version of this file should always be used when installing the package, since the file itself opens with the following line:

  # Do not edit -- this file documents how Postfix was built for your machine.

There does not seem to be a valid reason for a user to have a version of that file that differs at all from the package-provided version, then; any divergence, in fact, would be misleading.

Presumably then this file should be included in a way that does not require user intervention to update the makedefs.out file (ex. the /etc/ copy could just be a symlink to a copy in /usr/share/postfix/, or perhaps there's some packaging magic that could be done?).

Ran into this on a server running Ubuntu 18.04, when running upgrades which pulled down Postfix version 3.3.0-1ubuntu0.1.

Keith Z-G (keithzg)
description: updated
description: updated
Revision history for this message
Keith Z-G (keithzg) wrote :

Note that I attempted to file a bug upstream with Debian too (since that's where this packaging choice originated), but I think I might have mucked up the reporting format as I see no indication my bug ever reached upstream.

Revision history for this message
Keith Z-G (keithzg) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in postfix (Ubuntu):
status: New → Confirmed
Revision history for this message
Neal McBurnett (nealmcb) wrote :

Yes - very puzzling.

In my case it said

    Configuration file '/etc/postfix/makedefs.out'
    ==> Deleted (by you or by a script) since installation

I certainly don't recall deleting it.

I'm running Bionic.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Being in /etc made it a conffile by default which is what will give it all the handling about updated files that you were facing.
I agree that in general this would be a file one expected to be around in an informal way, but not be bothered with these questions.

IMHO this should be moved to e.g. /usr/share/postfix/makedefs.out
And yes there could be a symlink from the former /etc path, but I think that isn't strictly required.

Just like this maybe:
diff --git a/debian/changelog b/debian/changelog
index cfbe1683..fd2c3b45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+postfix (3.2.4-2) unstable; urgency=medium
+
+ * make makedefs.out no more be a conffile Closes: #908545
+
+ -- Christian Ehrhardt <email address hidden> Thu, 13 Sep 2018 14:23:22 +0200
+
 postfix (3.2.4-1) unstable; urgency=medium

   [Wietse Venema]
diff --git a/debian/postfix.maintscript b/debian/postfix.maintscript
new file mode 100644
index 00000000..7a81ec99
--- /dev/null
+++ b/debian/postfix.maintscript
@@ -0,0 +1,2 @@
+# moved to sharedir to not bother users with conffile prompts
+rm_conffile /etc/postfix/makedefs.out 3.2.4-2~ postfix
diff --git a/debian/rules b/debian/rules
index 59ca3d7d..a6a3bb20 100755
--- a/debian/rules
+++ b/debian/rules
@@ -174,7 +174,7 @@ install-arch: build-arch
        ln -s ../sbin/sendmail $(bindir)/mailq
        ln -s ../sbin/sendmail ${base}/usr/lib/sendmail
        install -m 0755 conf/postfix-script conf/post-install $(confdir)
- install -m 0644 conf/makedefs.out $(confdir)
+ install -m 0644 conf/makedefs.out $(sharedir)
        install -m 0644 debian/functions $(sharedir)/postinst.functions
        install -m 0644 conf/master.cf $(sharedir)/master.cf.dist
        install -m 0644 conf/main.cf.dist $(sharedir)/main.cf.dist

I'll suggest that to the Debian bug.

Changed in postfix (Debian):
status: Unknown → New
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Testing on what I proposed to Debian seems to work fine:

root@c:~# dpkg --status postfix | grep makedefs.out; ls -laF /etc/postfix/makedefs.out /usr/share/postfix/makedefs.out
 /etc/postfix/makedefs.out 109692331793570f2d0884efe222949b
ls: cannot access '/usr/share/postfix/makedefs.out': No such file or directory
-rw-r--r-- 1 root root 4480 May 9 12:51 /etc/postfix/makedefs.out
root@c:~# apt install postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite sasl2-bin dovecot-common resolvconf postfix-cdb mail-reader postfix-doc
The following packages will be upgraded:
  postfix
1 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.
Need to get 1149 kB of archives.
After this operation, 239 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ci-train-ppa-service/3415/ubuntu cosmic/main amd64 postfix amd64 3.3.0-1ubuntu2~test1 [1149 kB]
Fetched 1149 kB in 1s (845 kB/s)
Preconfiguring packages ...
(Reading database ... 53910 files and directories currently installed.)
Preparing to unpack .../postfix_3.3.0-1ubuntu2~test1_amd64.deb ...
Unpacking postfix (3.3.0-1ubuntu2~test1) over (3.3.0-1ubuntu1) ...
Processing triggers for ufw (0.35-6) ...
Processing triggers for systemd (239-7ubuntu7) ...
Processing triggers for man-db (2.8.4-2) ...
Processing triggers for rsyslog (8.32.0-1ubuntu5) ...
Setting up postfix (3.3.0-1ubuntu2~test1) ...
Removing obsolete conffile /etc/postfix/makedefs.out ...

Postfix (main.cf) configuration was not changed. If you need to make changes,
edit /etc/postfix/main.cf (and others) as needed. To view Postfix
configuration values, see postconf(1).

After modifying main.cf, be sure to run 'service postfix reload'.

Processing triggers for libc-bin (2.28-0ubuntu1) ...
root@c:~# dpkg --status postfix | grep makedefs.out; ls -laF /etc/postfix/makedefs.out /usr/share/postfix/makedefs.out
lrwxrwxrwx 1 root root 31 Sep 14 06:58 /etc/postfix/makedefs.out -> /usr/share/postfix/makedefs.out
-rw-r--r-- 1 root root 4480 Sep 13 12:23 /usr/share/postfix/makedefs.out

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This isn't sometihng we'd want to take a Delta in Ubuntu for IMHO, so I'm waiting if my Debian submission will be accepted.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1791853] Re: Postfix upgrade queries about replacing /etc/postfix/makedefs.out, when it really should always do so

On Monday, September 17, 2018 06:10:30 AM you wrote:
> This isn't sometihng we'd want to take a Delta in Ubuntu for IMHO, so
> I'm waiting if my Debian submission will be accepted.

I expect I'll apply the change, but am severely lacking in time right now.

It would help if you could submit a merge request on salsa.d.o [1].

Thanks,

Scott K

[1] https://salsa.debian.org/postfix-team/postfix-dev

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Scott, whenever you get to it will be fine.
MR done at https://salsa.debian.org/postfix-team/postfix-dev/merge_requests/1

Revision history for this message
Scott Kitterman (kitterman) wrote :

No idea why the remote bug status isn't updating, but this is fixed in Debian.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Scott for the info!
(I don't know why it didn't pick up the bug status change either)

Fixed in 3.3.2-2
Disco is on 3.3.2-4 and thereby fixed

IMHO this isn't important enough to SRU it, so the bug should be done for Ubuntu as well.

Changed in postfix (Ubuntu):
status: Confirmed → Fix Released
Changed in postfix (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.