3
# It is possible that Debconf has already been removed, too.
4
if [ -f /usr/share/debconf/confmodule ]; then
5
. /usr/share/debconf/confmodule
8
PERCONA_PREFIX=/opt/percona/percona-server-5.5
9
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin:$PERCONA_PREFIX/bin
11
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
12
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
14
MYADMIN="${PERCONA_PREFIX}/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
16
# Try to stop the server in a sane way. If it does not success let the admin
17
# do it himself. No database directories should be removed while the server
21
if [ -x /usr/sbin/invoke-rc.d ]; then
22
invoke-rc.d percona-server stop
24
/etc/init.d/percona-server stop
29
if [ "$?" != 0 ]; then
30
echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
31
echo "Stop it yourself and try again!" 1>&2
37
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
38
if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
44
echo "postrm called with unknown argument '$1'" 1>&2
50
# - Do NOT purge logs or data if another percona-server-server* package is installed (#307473)
51
# - Remove the mysql user only after all his owned files are purged.
53
if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then
54
# we remove the mysql user only after all his owned files are purged
55
rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
58
db_input high percona-server-server-5.5/postrm_remove_databases || true
60
db_get percona-server-server-5.5/postrm_remove_databases || true
61
if [ "$RET" = "true" ]; then
62
# never remove the debian.cnf when the databases are still existing
63
# else we ran into big trouble on the next install!
64
rm -f /etc/mysql/debian.cnf
66
rm -rf /var/run/mysqld
70
# (normally) Automatically added by dh_installinit
71
if [ "$1" = "purge" ] ; then
72
update-rc.d percona-server remove >/dev/null || exit 0
74
# (normally) End automatically added section
77
# (normally) Automatically added by dh_installdebconf
78
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
79
. /usr/share/debconf/confmodule
82
# (normally) End automatically added section
84
# no DEBHELPER here, "update-rc.d remove" fails if percona-server-server-5.5 is installed