On Saturday, April 22, 2017 03:54:05 PM Scott Kitterman wrote:
> On Saturday, April 22, 2017 07:28:00 PM Niels Thykier wrote:
> > On Sat, 15 Apr 2017 00:39:56 +0000 JC <prog...@andrele.org> wrote:
> > > Hi Scott,
> > > 
> > > Le ven. 14 avr. 2017 Ã  19:59, Scott Kitterman <deb...@kitterman.com> a
> > > 
> > > écrit :
> > > > Thanks for the patch.
> > > > I still need to review the underlying issue.  I suspect it is user
> > > > error.
> > > > Scott K
> > > 
> > > Well, I was not sure myself, so I did install postfix into new jessie
> > > and
> > > stretch VMs and I've seen myself the same differences between the
> > > dynamicmaps.cf.
> > > 
> > > The thing is: when you upgrade, the file is already created and
> > > provisioned
> > > with the map entries; but they are just not valid anymore with a stretch
> > > postfix installation, since the pathnames changed from
> > > /usr/lib/postfix/dict_XXX.so to postfix-XXX.so (notice the full path
> > > removal _and_ the file name change).
> > > 
> > > I did compare the addmap function from the debian/functions file between
> > > jessie and stretch and they _do_ differ in the map line generated.
> > > 
> > > So the map lines already there _do_ need to get updated, either by the
> > > user
> > > itself (in such case we should announce it in a README.upgrade or
> > > equivalent) or by Debian. My opinion here is that the postinst script
> > > could
> > > manage this upgrade here without much "conffile" modification conflict.
> > > 
> > > :-)
> > 
> > Hey Scott,
> > 
> > Did you have any comments to the above?
> > 
> > (FTR, "dynamicmaps.cf" can't be a conffile unless the original postinst
> > is RC buggy as it seems to generate dynamicmaps.cf - or are you talking
> > about a different file?)
> > 
> > Thanks
> > ~Niels
> 
> I do not think it's the correct fix for the problem.  I hope to work on this
> in the next day or three.  This may mask an issue, but it's not a fix.
> 
> Scott K

Testing in a small chroot:

Jessie:
# apt-get install postfix-ldap
Install postfix and postfix-ldap 2.11.3-1

# cat /etc/postfix/dynamicmaps.cf
# Postfix dynamic maps configuration file.
#
#type   location of .so file                    open function   (mkmap func)
#====   ================================        =============   ============
tcp     /usr/lib/postfix/dict_tcp.so            dict_tcp_open
sqlite  /usr/lib/postfix/dict_sqlite.so         dict_sqlite_open
ldap    /usr/lib/postfix/dict_ldap.so           dict_ldap_open

This is correct for postfix 2.11.

Update sources.list to stretch and upgrade.  Upgrades postfix and postfix-ldap 
to 3.1.4-1.

# cat /etc/postfix/dynamicmaps.cf
# Postfix dynamic maps configuration file.
#
#type   location of .so file                    open function   (mkmap func)
#====   ================================        =============   ============
tcp     /usr/lib/postfix/dict_tcp.so            dict_tcp_open
sqlite  /usr/lib/postfix/dict_sqlite.so         dict_sqlite_open
ldap    /usr/lib/postfix/dict_ldap.so           dict_ldap_open

Upgrade problem confirmed.

New install on stretch:

# cat /etc/postfix/dynamicmaps.cf
sqlite  postfix-sqlite.so       dict_sqlite_open
ldap    postfix-ldap.so dict_ldap_open

Restart on jessie, but add delmap to prerm in jessie.  After upgrade to 
stretch with 3.1.4:

# cat /etc/postfix/dynamicmaps.cf
# Postfix dynamic maps configuration file.
#
#type   location of .so file                    open function   (mkmap func)
#====   ================================        =============   ============
ldap    postfix-ldap.so dict_ldap_open
sqlite  postfix-sqlite.so       dict_sqlite_open

Which is correct.

I think this is the more correct way to solve the problem.  I'll pursue a 
stable update to fix it there (debdiff attached for reference).

Scott K
diff -u postfix-2.11.3/debian/changelog postfix-2.11.3/debian/changelog
--- postfix-2.11.3/debian/changelog
+++ postfix-2.11.3/debian/changelog
@@ -1,3 +1,11 @@
+postfix (2.11.3-1+deb8u1) stable; urgency=medium
+
+  * Add delmap to .prerm for all packages that contain map data types exposed
+    through external .so files so that upgrades to stretch (where the
+    associated files have moved) will be functional (Closes: #859805)
+
+ -- Scott Kitterman <sc...@kitterman.com>  Mon, 24 Apr 2017 13:15:36 -0400
+
 postfix (2.11.3-1) unstable; urgency=medium
 
   [Wietse Venema]
diff -u postfix-2.11.3/debian/postfix-cdb.prerm postfix-2.11.3/debian/postfix-cdb.prerm
--- postfix-2.11.3/debian/postfix-cdb.prerm
+++ postfix-2.11.3/debian/postfix-cdb.prerm
@@ -15,8 +15,11 @@
 #          <conflicting-package> <version>
 # for details, see /usr/share/doc/packaging-manual/
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     remove|upgrade|deconfigure)
+        delmap cdb
 #       install-info --quiet --remove /usr/info/#PACKAGE#.info.gz
         ;;
     failed-upgrade)
diff -u postfix-2.11.3/debian/postfix-ldap.prerm postfix-2.11.3/debian/postfix-ldap.prerm
--- postfix-2.11.3/debian/postfix-ldap.prerm
+++ postfix-2.11.3/debian/postfix-ldap.prerm
@@ -15,8 +15,11 @@
 #          <conflicting-package> <version>
 # for details, see /usr/share/doc/packaging-manual/
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     remove|upgrade|deconfigure)
+        delmap ldap
 #       install-info --quiet --remove /usr/info/#PACKAGE#.info.gz
         ;;
     failed-upgrade)
diff -u postfix-2.11.3/debian/postfix-mysql.prerm postfix-2.11.3/debian/postfix-mysql.prerm
--- postfix-2.11.3/debian/postfix-mysql.prerm
+++ postfix-2.11.3/debian/postfix-mysql.prerm
@@ -15,8 +15,11 @@
 #          <conflicting-package> <version>
 # for details, see /usr/share/doc/packaging-manual/
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     remove|upgrade|deconfigure)
+        delmap mysql
 #       install-info --quiet --remove /usr/info/#PACKAGE#.info.gz
         ;;
     failed-upgrade)
diff -u postfix-2.11.3/debian/postfix-pcre.prerm postfix-2.11.3/debian/postfix-pcre.prerm
--- postfix-2.11.3/debian/postfix-pcre.prerm
+++ postfix-2.11.3/debian/postfix-pcre.prerm
@@ -15,8 +15,11 @@
 #          <conflicting-package> <version>
 # for details, see /usr/share/doc/packaging-manual/
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     remove|upgrade|deconfigure)
+        delmap pcre
 #       install-info --quiet --remove /usr/info/#PACKAGE#.info.gz
         ;;
     failed-upgrade)
diff -u postfix-2.11.3/debian/postfix-pgsql.prerm postfix-2.11.3/debian/postfix-pgsql.prerm
--- postfix-2.11.3/debian/postfix-pgsql.prerm
+++ postfix-2.11.3/debian/postfix-pgsql.prerm
@@ -15,8 +15,11 @@
 #          <conflicting-package> <version>
 # for details, see /usr/share/doc/packaging-manual/
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     remove|upgrade|deconfigure)
+        delmap pgsql
 #       install-info --quiet --remove /usr/info/#PACKAGE#.info.gz
         ;;
     failed-upgrade)
diff -u postfix-2.11.3/debian/postfix.prerm postfix-2.11.3/debian/postfix.prerm
--- postfix-2.11.3/debian/postfix.prerm
+++ postfix-2.11.3/debian/postfix.prerm
@@ -3,6 +3,8 @@
 # Debian Postfix prerm
 # LaMont Jones <lam...@debian.org>
 
+. /usr/share/postfix/postinst.functions
+
 case "$1" in
     upgrade)
 	new=$2			# get new version
@@ -23,6 +25,8 @@
 		mv ${MASTER}.$$ ${MASTER}
 	    fi
 	fi
+	delmap tcp
+	delmap sqlite
 	;;
 
     deconfigure)

Reply via email to