On Tue, 1 Feb 2005 16:07:56 +0000, John Madden <maddenj+ilug at skynet.ie> wrote:
> On (01/02/05 15:36), Michael Thompson didst pronounce:
> >
> > Nope that doesn't work, when I run the install step it seems to
> > remember that I have previously configure this package so doesn't ask
> > me thoose questions again.
> >
> apt-get remove cacti && dpkg --purge cacti
>> then re-install it. The --purge will remove all its config files, which
> are sometimes kept after an uninstall.
No the post removal script fails.
Purging configuration files for cacti ...
ERROR 1045: Access denied for user: 'root at localhost' (Using password: YES)
dpkg: error processing cacti (--purge):
subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
cacti
Looking at the script, /var/lib/dpkg/info/cacti.postrm where are the
values of $RET set?
#! /bin/sh
# postrm script for mifluz
#
# see: dh_installdeb(1)
set -e
get_config()
{
db_get cacti/mysql_server
mysql_server="$RET"
db_get cacti/database
database="$RET"
db_get cacti/root_mysql
root_mysql="$RET"
db_get cacti/root_password
root_passwd="$RET"
db_get cacti/username
username="$RET"
db_get cacti/password
password="$RET"
db_get cacti/purge_db
purge_db="$RET"
db_get cacti/webserver
webserver="$RET"
}
case "$1" in
purge)
. /usr/share/debconf/confmodule
db_version 2.0
get_config
mysqlpwd=""
if [ "$root_passwd" != 'none' ]; then
mysqlpwd="-p${root_passwd}"
fi
mysqlcmd="mysql -h ${mysql_server} -u${root_mysql} ${mysqlpwd}"
includefile=/etc/cacti/apache.conf
server=${webserver}
servers=${webserver}
. /usr/share/wwwconfig-common/apache-uninclude_all.sh
if [ "$status" = "purge" ]
then
restart="${webserver}"
fi
test -d /etc/cacti && rm -rf /etc/cacti
if [ "${purge_db}" = "true" ]
then
$mysqlcmd -e "drop database ${database}"
$mysqlcmd -e "delete from user where
user='${username}' and host='${mysql_server}'" mysql
$mysqlcmd -e "delete from db where
user='${username}' and host='${mysql_server}'" mysql
fi
;;
remove)
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!