summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorBalasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>2013-05-13 09:46:44 +0200
committerBalasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>2013-05-13 09:46:44 +0200
commit28db0437745fd567ff5e6a1ec9203dfccc19890f (patch)
tree7addfc9811c5e4ac8c11c7cde9739dce50230165 /support-files
parentc50620f1d3871639a336fc1b2fdae7e7d5b80bc1 (diff)
downloadmariadb-git-28db0437745fd567ff5e6a1ec9203dfccc19890f.tar.gz
Adding fix for Bug#16798868
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mysql.spec.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index c153b22b7c5..9e49db8a9c1 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -974,6 +974,35 @@ mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun"
#scheduled service packs and more. Visit www.mysql.com/enterprise for more
#information."
+%preun -n MySQL-server%{product_suffix}
+
+# Which '$1' does this refer to? Fedora docs have info:
+# " ... a count of the number of versions of the package that are installed.
+# Action Count
+# Install the first time 1
+# Upgrade 2 or higher (depending on the number of versions installed)
+# Remove last version of package 0 "
+#
+# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
+
+if [ $1 = 0 ] ; then
+ # Stop MySQL before uninstalling it
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql stop > /dev/null
+ # Remove autostart of MySQL
+ # use chkconfig on Enterprise Linux and newer SuSE releases
+ if [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --del mysql
+ # For older SuSE Linux versions
+ elif [ -x /sbin/insserv ] ; then
+ /sbin/insserv -r %{_sysconfdir}/init.d/mysql
+ fi
+ fi
+fi
+
+# We do not remove the mysql user since it may still own a lot of
+# database files.
+
%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community
# Setup: We renamed this package, so any existing "server-community"