Amavis --> aptitude/apt-get ->postinstall error 1

Bonjour à tous,

Je viens d’acquérir un serveur dédié chez Kimsufi est d’installer la distribution Ispconfig debian 8.

Je me connecte en ssh avec l’utilisateur root afin de m’assurer afin de procéder à la mise à jour du système et des paquets, si besoin.

Je commence donc par apt-get update suivi de apt-get upgrade, mais je reçoit un message d’erreur

le sous-processus script post-installation installé a retourné une erreur de sortie d’état 1
Des erreurs ont été rencontrées pendant l’exécution :
amavisd-new

Bon, j’essaye avec aptitude, mais celui-ci n’est pas installé donc je l’installe apt-get install aptitude et poursuit par aptitude update et aptitude upgrade. Même problème.

Après quelque recherche, je trouve divers topic que j’essaye de suivre, mais rien n’y fait et comme je suis relativement débutant dans le domaine, je m’arrête quand je comprends plus rien à ce qui est ecrit, et cherche un post/explication/tuto plus abordable.

Mais là je coince.

Merci pour votre aide pour mon premier serveur sous debian, 15ans après avoir fais mes premières install de debian et slackware, à l’époque, juste pour voir…

PS :
J’ai choisi cette distribution car j’ai également un vps sur lequel je me suis fait les dent en partant d’une ubuntu server 16.04 et sur lequel j’ai moi même installé Ispconfig ainsi que des version de php alternative, et so far so good depuis près d’un an.

PS 2 :
Voici quelque info qui peuvent vous être utile

ce que me retourne aptitude upgrade

amavisd-new
Aucun paquet ne va être installé, mis à jour ou enlevé.
0 paquets mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
Il est nécessaire de télécharger 0 o d’archives. Après dépaquetage, 0 o seront utilisés.
Paramétrage de amavisd-new (1:2.10.1-2~deb8u1) …
Creating/updating amavis user account…
Job for amavis.service failed. See ‘systemctl status amavis.service’ and ‘journalctl -xn’ for details.
invoke-rc.d: initscript amavis, action “start” failed.
dpkg: erreur de traitement du paquet amavisd-new (–configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d’état 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package. Trying to recover:
Paramétrage de amavisd-new (1:2.10.1-2~deb8u1) …
Creating/updating amavis user account…
Job for amavis.service failed. See ‘systemctl status amavis.service’ and ‘journalctl -xn’ for details.
invoke-rc.d: initscript amavis, action “start” failed.
dpkg: erreur de traitement du paquet amavisd-new (–configure) :
le sous-processus script post-installation installé a retourné une erreur de sortie d’état 1
Des erreurs ont été rencontrées pendant l’exécution :
amavisd-new

nano /etc/apt/sources.list (les liens sont précdé de XXX faute de quoi je ne pouvais pas poster mon message)

#deb XXXhttp://debian.mirrors.ovh.net/debian/ jessie main
#deb-src XXXhttp://debian.mirrors.ovh.net/debian/ jessie main

deb XXXhttp://security.debian.org/ jessie/updates main
deb-src XXXhttp://security.debian.org/ jessie/updates main

jessie-updates, previously known as ‘volatile’

deb XXXhttp://debian.mirrors.ovh.net/debian/ jessie-updates main
deb-src XXXhttp://debian.mirrors.ovh.net/debian/ jessie-updates main

jessie-backports, previously on backports.debian.org

deb XXXhttp://debian.mirrors.ovh.net/debian/ jessie-backports main
deb-src XXXhttp://debian.mirrors.ovh.net/debian/ jessie-backports main

deb XXXhttp://debian.mirrors.ovh.net/debian/ jessie main contrib non-free
deb-src XXXhttp://debian.mirrors.ovh.net/debian/ jessie main contrib non-free

nano /var/lib/dpkg/info/amavisd-new.postrm

#! /bin/sh

postrm script for amavis-perl

$Id: amavisd-new.postrm 864 2006-04-17 12:57:55Z hmh $

see: dh_installdeb(1)

set -e

summary of how this script can be called:

* `remove’

* `purge’

* `upgrade’

* `failed-upgrade’

* `abort-install’

* `abort-install’

* `abort-upgrade’

* <disappearer’s-postrm> `disappear’ overwrit>r>

for details, see http://www.debian.org/doc/debian-policy/ or

the debian-policy package

case “$1” in
purge)
[ -r /usr/share/debconf/confmodule ] && {
. /usr/share/debconf/confmodule
db_purge || true
db_stop || true
}

for i in /var/lib/amavis /var/lib/amavis/db /var/lib/amavis/tmp
/var/lib/amavis/virusmails /var/run/amavis
do
dpkg-statoverride --remove $i || true
done

if getent passwd amavis >/dev/null; then
if [ -x /usr/sbin/deluser ]; then
deluser --system amavis
fi
fi

    if getent group amavis >/dev/null; then
            if [ -x /usr/sbin/delgroup ]; then
                    delgroup --system amavis
            fi
    fi

echo “Removing amavis files and directories…”
[ -d /var/lib/amavis ] && rm -fr /var/lib/amavis
[ -d /etc/amavis ] && rm -fr /etc/amavis
;;

   remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;
*)
    echo "postrm called with unknown argument \`$1'" >&2
    exit 1

esac

dh_installdeb will replace this with shell code automatically

generated by other debhelper scripts.

Automatically added by dh_installinit

if [ “$1” = “purge” ] ; then
update-rc.d amavis-mc remove >/dev/null
fi

In case this system is running systemd, we make systemd reload the unit files

to pick up changes.

if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi

End automatically added section

Automatically added by dh_installinit

if [ “$1” = “purge” ] ; then
update-rc.d amavisd-snmp-subagent remove >/dev/null
fi

In case this system is running systemd, we make systemd reload the unit files

to pick up changes.

if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi

End automatically added section

Automatically added by dh_installinit

if [ “$1” = “purge” ] ; then
update-rc.d amavis remove >/dev/null
fi

In case this system is running systemd, we make systemd reload the unit files

to pick up changes.

if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi

End automatically added section

exit 0

et nano /var/lib/dpkg/info/amavisd-new.postinst

#! /bin/sh

postinst script for amavisd-new

$Id: amavisd-new.postinst 908 2006-06-09 03:42:01Z hmh $

see: dh_installdeb(1)

set -e

summary of how this script can be called:

* `configure’

* `abort-upgrade’

* <conflictor’s-postinst> abort-remove'in-favour’

* <deconfigured’s-postinst> abort-deconfigure'in-favour’

`removing’

for details, see http://www.debian.org/doc/debian-policy/ or

the debian-policy package

quoting from the policy:

Any necessary prompting should almost always be confined to the

post-installation script, and should be protected with a conditional

so that unnecessary prompting doesn’t happen if a package’s

installation fails and the postinst' is called withabort-upgrade’,

abort-remove' orabort-deconfigure’.

case “$1” in
configure)

add amavis system user and group (requires adduser >= 3.34)

don’t muck around with this unless you KNOW what you’re doing

also, don’t attempt to second guess what kind of fucked up

mistakes other amavis packages might have made. Tell the user

to kill the bogus entry. We can’t simply overwrite it with

usermod, since that would certainly cause severe headaches for

a sysadmin out there…

I don’t care that users migrating from other amavis packages

will have extra work. Someone lost 30GB because we tried to

be nice once. See #190414.

echo “Creating/updating amavis user account…” >&2
if ! getent group amavis > /dev/null ; then
addgroup --quiet --system amavis || {
# addgroup failed. Why?
if ! getent group amavis >/dev/null ; then
echo “Could not create system group amavis.” >&2
exit 1
fi
# well, the group is there, so just ignore the error
}
fi
if ! getent passwd amavis > /dev/null ; then

  adduser --system --ingroup amavis --home /var/lib/amavis \
  --gecos "AMaViS system user" --shell /bin/sh \
  --quiet --disabled-password amavis || {
  # adduser failed. Why?
  if getent passwd amavis >/dev/null ; then
  	echo "Non-system user amavis found. I will not overwrite a non-system" >&2
  	echo "user.  Remove the user and reinstall amavisd-new." >&2
  	exit 1
  fi
  # unknown adduser error, simply exit
  exit 1

}

fi

Clean up after #190414

homedir=$(getent passwd amavis | cut -d : -f 6)
if [ “x${homedir}” = “x/” ] ; then
echo ‘WARNING! Homedir of user amavis was set to “/”, this is’ >&2
echo ‘extremely dangerous! Overriding it to /var/lib/amavis…’ >&2
homedir=/var/lib/amavis
usermod -d “${homedir}” amavis
fi

Sanity-checks (see #367807)

if [ ! -d “${homedir}” ] ; then
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

in order to give all critical dirs sane permissions we first check

if we have the packages standard permissions, if yes we delete them,

if no we alert the admin.

for i in /var/lib/amavis:755:0750:amavis:amavis /var/lib/amavis/db:755:0750:amavis:amavis
/var/lib/amavis/tmp:755:0770:amavis:amavis /var/lib/amavis/virusmails:755:0750:amavis:amavis
do
dir=$(echo $i | cut -d : -f 1)
perms_local=$(dpkg-statoverride --list “$dir” | awk ‘{print $4,$3,$1,$2}’ | tr -s " " “:”)
if [ “$perms_local” ] ; then
perms_old=$(echo $i | cut -d : -f 1,2,4,5)
perms_new=$(echo $i | cut -d : -f 1,3,4,5)
mode_others=$(dpkg-statoverride --list “$dir” | awk ‘{print $3}’ | sed ‘s/.*([0-9]{1})$/\1/’)
if [ “$perms_local” = “$perms_old” ] ; then
dpkg-statoverride --remove "$dir"
elif [ “$perms_local” != “$perms_new” ] && [ “$mode_others” != “0” ] ; then
echo
echo "WARNING: $dir has set custom permissions which may be too open - please take a look at README.Debian!"
echo
fi
fi
done

umask 022
for i in /var/lib/amavis:0750 /var/lib/amavis/db:0750 /var/lib/amavis/tmp:0770
/var/lib/amavis/virusmails:0750 /var/run/amavis:0755
do
dir=$(echo $i | cut -d : -f 1)
perm=$(echo $i | cut -d : -f 2)
if [ ! -d “$dir” ] ; then
mkdir -p "$dir"
fi
if ! dpkg-statoverride --list “$dir” > /dev/null ; then
dpkg-statoverride --update --add amavis amavis “$perm” "$dir"
fi
done

Conffile upgrade handling

Work around dpkg not deleting removed conffiles

(template directories (with files) removed in 1:2.3.3-2)

if dpkg --compare-versions “1:2.3.3-2” gt-nl “$2” ; then
for i in pt_BR fr it_IT de_DE ; do
if [ -e “/etc/amavis/$i” ] ; then
echo “Moving outdated l10n template to /etc/amavis/${i}.outdated_for_2.3.3-2” >&2
mv “/etc/amavis/$i” "/etc/amavis/${i}.outdated_for_2.3.3-2"
fi
done
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
;;

esac

dh_installdeb will replace this with shell code automatically

generated by other debhelper scripts.

init_failed ()
{
echo “WARNING: Starting amavisd-new failed. Please check your configuration.”
}

Automatically added by dh_installinit

if [ -x “/etc/init.d/amavis” ]; then
update-rc.d amavis defaults >/dev/null
invoke-rc.d amavis start || exit $?
fi

End automatically added section

Automatically added by dh_installinit

if [ -x “/etc/init.d/amavisd-snmp-subagent” ]; then
update-rc.d amavisd-snmp-subagent defaults >/dev/null
invoke-rc.d amavisd-snmp-subagent start || exit $?
fi

End automatically added section

Automatically added by dh_installinit

if [ -x “/etc/init.d/amavis-mc” ]; then
update-rc.d amavis-mc defaults >/dev/null
invoke-rc.d amavis-mc start || exit $?
fi

End automatically added section

exit 1