On Sun, 16 Apr 2006, Henrique de Moraes Holschuh wrote:
> On Sun, 16 Apr 2006, Justin Pryzby wrote:
> > dpkg: error processing amavisd-new (--purge):
> >  subprocess post-removal script returned error exit status 128
> 
> Exit status 128 is an unusual return status.  Moreover, debconf should never
> return it.  WTF?  129 would be killed by SIGHUP, but 128 has no definition.
> 
> If we cannot reproduce this, it will be quite hard to find out what is
> happening :(

Tracked down to dh_installdebconf-induced breakage.

dh_installdebconf inserts code into the postrm which calls db_purge
(unprotected, but a debconf protocol dump shows that PURGE returns status
0).  It fails to call db_stop, as warned by #133029.

This leaves our postinst will all stdout output redirected into confmodule,
which seems to cause the mess.

Editing /var/lib/dpkg/info/amavisd-new.postrm first line to #!/bin/sh -x
shows that, as expected, calling confmodule in the middle of the script is
an extremely dumb thing to do, as it runs part of the script twice...

Instead of moving #DEBHELPER# to the top of the script, or trying to
second-guess what kind of mess we could get into yet again, I am disabling
debhelper-included dh_installdebconf scripts, and doing it by ourselves.

Report cc'ed to #133029 so that Joey can be reminded of that report, and
that it does cause issues on real world packages (note that I am not blaming
the bug on debhelper, it is just that our usage is not compatible with the
script it produces).

Just for the kick of it, here's the full dump, with debconf protocol debug
enabled.

(steps to reproduce):
login in a sarge chroot (pbuilder, new debootstrap one)
apt-get install amavisd-new
sed -i s/sarge/testing/g /etc/apt/sources.list 
apt-get update ; apt-get install amavisd-new

(amavisd-new will be upgraded correctly)

export DEBCONF_DEBUG=developer
sed -i '1 [EMAIL PROTECTED]@#!/bin/sh -x@' 
/var/lib/dpkg/info/amavisd-new.postrm 
dpkg -P amavisd-new


[output of dpkg -P amavisd-new]
(Reading database ... 12164 files and directories currently installed.)
Removing amavisd-new ...
+ set -e
+ '[' remove = purge ']'
+ '[' remove = purge ']'
+ exit 0
Purging configuration files for amavisd-new ...
+ set -e
+ dpkg-statoverride --remove /var/lib/amavis
+ dpkg-statoverride --remove /var/lib/amavis/db
+ dpkg-statoverride --remove /var/lib/amavis/tmp
+ dpkg-statoverride --remove /var/lib/amavis/virusmails
+ dpkg-statoverride --remove /var/run/amavis
+ getent passwd amavis
+ deluser amavis
Removing user `amavis'...
done.
+ getent group amavis
+ echo 'Removing amavis files and directories...'
Removing amavis files and directories...
+ '[' -d /var/lib/amavis ']'
+ rm -fr /var/lib/amavis
+ '[' -d /etc/amavis ']'
+ rm -fr /etc/amavis
+ '[' purge = purge ']'
+ '[' -e /usr/share/debconf/confmodule ']'
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/amavisd-new.postrm
purge
debconf (developer): frontend started
debconf (developer): frontend running, package name is amavisd-new
debconf (developer): starting /var/lib/dpkg/info/amavisd-new.postrm purge
+ set -e
+ dpkg-statoverride --remove /var/lib/amavis
No override present.
+ true
+ dpkg-statoverride --remove /var/lib/amavis/db
No override present.
+ true
+ dpkg-statoverride --remove /var/lib/amavis/tmp
No override present.
+ true
+ dpkg-statoverride --remove /var/lib/amavis/virusmails
No override present.
+ true
+ dpkg-statoverride --remove /var/run/amavis
No override present.
+ true
+ getent passwd amavis
+ getent group amavis
+ echo 'Removing amavis files and directories...'
debconf (developer): <-- Removing amavis files and directories...
+ '[' -d /var/lib/amavis ']'
+ '[' -d /etc/amavis ']'
+ '[' purge = purge ']'
+ '[' -e /usr/share/debconf/confmodule ']'
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ db_purge
+ _db_cmd 'PURGE '
+ echo 'PURGE '
debconf (developer): <-- PURGE 
+ local 'IFS=
'
+ local _LINE
+ read -r _LINE
+ RET=20 Unsupported command "removing" (full line was "Removing amavis
files an
d directories...") received from confmodule.
+ return 20
debconf (developer): --> 0
dpkg: error processing amavisd-new (--purge):
 subprocess post-removal script returned error exit status 128
Errors were encountered while processing:
 amavisd-new


-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to