Package: amavisd-new
Version: 1:2.6.1.dfsg-1
Severity: normal

If this package is purged and reinstalled, the reinstall fails because
the amavis user's home directory is deleted, but the amavis user and
group are not.

    # dpkg --configure amavisd-new
    Setting up amavisd-new (1:2.5.3-1ubuntu3) ...
    Creating/updating amavis user account...
    Broken amavis system user found.  To insure data-safety,
    it is up to you the local administrator to remove the broken
    amavis user, or repair it so that it is sane
    dpkg: error processing amavisd-new (--configure):
     subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
     amavisd-new

PS: "ensure" is misspelled, there are missing commas, and there is no
period at the end of the sentence.

As a resolution to #431853, simply leaving a broken user and group
lying around is *not* sensible.  It would be better to call deluser,
but succeed on error 127 (deluser not found).  The attached patch
demonstrates this.  Note that this approach is taken by many other
packages: bitlbee, ntp, openssh-server, logcheck, dnsmasq and
dhcp3-client, on my system.

I note that bitlbee and ntp, at least, happily call deluser in the
postrm script.  If leaving users around was the solution 

diff -wpurNd amavisd-new-2.6.1/debian/amavisd-new.postinst 
amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postinst
--- amavisd-new-2.6.1/debian/amavisd-new.postinst       2008-08-19 
15:27:33.522289854 +1000
+++ amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postinst      2008-08-19 
15:18:01.000000000 +1000
@@ -72,9 +72,9 @@ case "$1" in
 
        # Sanity-checks (see #367807)
        if [ ! -d "${homedir}" ] ; then
-         echo "Broken amavis system user found.  To ensure data-safety," >&2
-         echo "it is up to you, the local administrator, to remove the broken" 
>&2
-         echo "amavis user, or repair it so that it is sane." >&2
+         echo "Broken amavis system user found.  To insure data-safety," >&2
+         echo "it is up to you the local administrator to remove the broken" 
>&2
+         echo "amavis user, or repair it so that it is sane" >&2
          exit 1
        fi
 
diff -wpurNd amavisd-new-2.6.1/debian/amavisd-new.postrm 
amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postrm
--- amavisd-new-2.6.1/debian/amavisd-new.postrm 2008-08-19 15:27:33.554286445 
+1000
+++ amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postrm        2008-08-19 
15:18:01.000000000 +1000
@@ -33,10 +33,8 @@ case "$1" in
                dpkg-statoverride --remove $i || true
        done
 
-       echo "Removing amavis user and files..."
-       # The test prevents purge from failing if there is no amavis user.
-       delgroup --quiet --system amavis || test $? -eq 2 -o $? -eq 127
-       deluser --quiet --system --remove-home amavis || test $? -eq 2 -o $? 
-eq 127
+       echo "Removing amavis files and directories..."
+       [ -d /var/lib/amavis ] && rm -fr /var/lib/amavis
        [ -d /etc/amavis ] && rm -fr /etc/amavis
         ;;
 



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

Reply via email to