Bonjour, et merci à nouveau pour ta dispo
[code]racine@ordi3:/home/untel# cat /var/lib/dpkg/info/nuxeo.postrm
#!/bin/bash -e
ways we can be called
http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
postrm remove
postrm purge
old-postrm upgrade new-version
new-postrm failed-upgrade old-version
new-postrm abort-install
new-postrm abort-install old-version
new-postrm abort-upgrade old-version
disappearer’s-postrm disappear overwriter overwriter-version
. /usr/share/debconf/confmodule
db_version 2.0
PGCLUSTER="nuxeodb"
PGDEFAULTVERSION=“8.4”
delete_user() {
if getent passwd nuxeo >/dev/null; then
echo "*** Removing user nuxeo ***"
delusercmd=$(which deluser)
if [ -n “$delusercmd” ] && [ -x $delusercmd ]; then
deluser nuxeo
else
echo “cannot remove nuxeo: deluser command not found” >&2
fi
fi
}
cleanup_nuxeo_cluster() {
# If we have a nuxeo cluster:
# - drop the database for this product
# - drop the user for this product
# - if it was the last user beside postgres, drop the cluster
pushd /tmp > /dev/null
nxcluster=$(pg_lsclusters -h | grep $PGCLUSTER) || true
if [ ! -z "$nxcluster" ]; then
echo "*** Removing database dedicated to nuxeo ***"
pgversion=$(echo $nxcluster | awk '{print $1}')
pgport=$(echo $nxcluster | awk '{print $3}')
pgstatus=$(echo $nxcluster | awk '{print $4}')
pgwasstarted=true
# we need the cluster to be online for this
if [ "$pgstatus" != "online" ]; then
pgwasstarted=false
pg_ctlcluster $pgversion $PGCLUSTER start
fi
su postgres -c "psql -p $pgport template1 --quiet -t -c 'DROP DATABASE IF EXISTS nuxeo'"
su postgres -c "psql -p $pgport template1 --quiet -t -c 'DROP USER IF EXISTS nuxeo'"
num=$(su postgres -c "psql -p $pgport template1 --quiet -t -c 'SELECT usename FROM pg_user'" | grep -v -E "^$" | wc -l)
# No user left beside postgres
if [ "$num" = "1" ]; then
# drop cluster
pg_dropcluster --stop $pgversion $PGCLUSTER
# do shmmax deconfiguration
currentmax=$(grep -E "^kernel.shmmax\s*=" /etc/sysctl.conf | cut -d= -f2 | tr -d ' ')
beforemax=$(grep -E "^# Before nuxeo install: shmmax =" /etc/sysctl.conf | cut -d= -f2 | tr -d ' ')
aftermax=$(grep -E "^# After nuxeo install: shmmax =" /etc/sysctl.conf | cut -d= -f2 | tr -d ' ')
# don't do anything if the values were modified by the user
if [ ! -z "$beforemax" ] && [ ! -z "$aftermax" ]; then
if [ "$currentmax" = "$aftermax" ]; then
perl -n -i -e "print unless /^# Do not remove those lines \(needed by Nuxeo removal scripts\):/" /etc/sysctl.conf
perl -n -i -e "print unless /^# Before nuxeo install: shmmax =/" /etc/sysctl.conf
perl -n -i -e "print unless /^# After nuxeo install: shmmax =/" /etc/sysctl.conf
perl -p -i -e "s/^kernel.shmmax\s*=.*$/kernel.shmmax = $beforemax/" /etc/sysctl.conf
sysctl -w kernel.shmmax=$beforemax
fi
fi
# There are still other users in the database
elif [ "$pgwasstarted" = "false" ]; then
pg_ctlcluster $pgversion $PGCLUSTER stop
fi
fi
popd > /dev/null
}
case “$1” in
purge)
# Make sure all the files are removed
rm -rf /var/lib/nuxeo/server
rm -rf /var/lib/nuxeo/data
rm -rf /var/log/nuxeo
rm -rf /var/run/nuxeo
# Don't remove /etc/nuxeo as there may be custom user templates there
# But remove the marketplace packages list cache
if [ -f "/etc/nuxeo/pkglist.cache" ]; then
rm -f "/etc/nuxeo/pkglist.cache"
fi
# Remove the user if we created it
db_get nuxeo/installeduser || true
if [ "$RET" = "true" ]; then
delete_user
fi
# Purge database if we created it
db_get nuxeo/installedpg || true
if [ "$RET" = "true" ]; then
cleanup_nuxeo_cluster
fi
# Purge debconf answers
db_purge
;;
remove)
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument" >&2
exit 1
;;
esac
Automatically added by dh_installinit
if [ “$1” = “purge” ] ; then
update-rc.d nuxeo remove >/dev/null
fi
End automatically added section[/code]
racine@ordi3:/home/untel# ls -la /var/lib/dpkg/status-old
-rw-r--r-- 1 root root 1986281 févr. 25 18:23 /var/lib/dpkg/status-old