tags 665487 patch
thanks

Hi,

On Sat, Mar 24, 2012 at 05:11:33PM +0100, Laurens Blankers wrote:
> When upgrading dovecot from 2.0.15-1 to 1:2.0.18-1 the configuration failed
> withe errors related to managesieved.

> dpkg: warning: subprocess old post-removal script returned error exit status
> 1

The problem is that the postrm script of each dovecot plugin tries to start
dovecot unconditionally. It should only start dovecot when the plugin was
removed or purged, not when the plugin in being upgraded. In that case, the
postrm will run when the files from the plugin package have been replaced by
the files from the newer version, but you cannot be sure that the files from
dovecot-core will be upgraded at that point.

On upgrade, dovecot will be started by the postinst script of the plugin. By
the time this runs, the version of dovecot-core and dovecot-(plugin) will be
the same (because there is a strict versioned dependency). So there will be no
version mismatch.

The attached (UNTESTED!) patch probably fixes this problem for
dovecot-managesieved.

This problem likely affects the other dovecot plugins with similar maintainer
scripts in the same way.


Cheers,

Ivo


--- dovecot-managesieved.postrm	2012-06-22 06:32:02.000000000 +0200
+++ dovecot-managesieved.postrm.new	2012-08-19 00:59:42.762939921 +0200
@@ -26,13 +26,13 @@
 
 if [ "$1" = "purge" ] || [ "$1" = "remove" ]; then
 	rm -f /usr/share/dovecot/protocols.d/managesieved.protocol
-fi
 
-if [ -x "/etc/init.d/dovecot" ]; then
-	if [ -x /usr/sbin/invoke-rc.d ] ; then
-		invoke-rc.d dovecot start
-	else
-		/etc/init.d/dovecot start
+	if [ -x "/etc/init.d/dovecot" ]; then
+		if [ -x /usr/sbin/invoke-rc.d ] ; then
+			invoke-rc.d dovecot start
+		else
+			/etc/init.d/dovecot start
+		fi
 	fi
 fi
 

Reply via email to