summaryrefslogtreecommitdiff
path: root/support-files/rpm
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-05-04 17:04:55 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-05-04 17:04:55 +0200
commit8cbb14ef5d180687f131bc44a4e8fc84083d033c (patch)
tree091f11e2d20f95656a7b12294782eb0488fd4fcc /support-files/rpm
parent4345868382ca3525de5eb432302b6b9b957b47c1 (diff)
parentb85aa20065504bdda4bc03c2bd7eb7de38865c5d (diff)
downloadmariadb-git-8cbb14ef5d180687f131bc44a4e8fc84083d033c.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'support-files/rpm')
-rw-r--r--support-files/rpm/server-postin.sh7
-rw-r--r--support-files/rpm/server-posttrans.sh7
-rw-r--r--support-files/rpm/server-preun.sh18
3 files changed, 15 insertions, 17 deletions
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh
index 08b046dc272..57db9fd5d90 100644
--- a/support-files/rpm/server-postin.sh
+++ b/support-files/rpm/server-postin.sh
@@ -17,9 +17,7 @@ fi
if [ $1 = 1 ] ; then
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
- fi
-
- if [ -x /sbin/chkconfig ] ; then
+ elif [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
fi
@@ -55,9 +53,6 @@ if [ $1 = 1 ] ; then
chown -R %{mysqld_user}:%{mysqld_group} $datadir
if [ ! -e $datadir/mysql ]; then
- # Create data directory
- mkdir -p $datadir/{mysql,test}
-
# Initiate databases
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
fi
diff --git a/support-files/rpm/server-posttrans.sh b/support-files/rpm/server-posttrans.sh
index 0d242596185..1406c78a5f5 100644
--- a/support-files/rpm/server-posttrans.sh
+++ b/support-files/rpm/server-posttrans.sh
@@ -2,10 +2,9 @@ if [ -r %{restart_flag} ] ; then
rm %{restart_flag}
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1
- fi
-
- # only restart the server if it was alredy running
- if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
+ /usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1
+ elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
+ # only restart the server if it was alredy running
%{_sysconfdir}/init.d/mysql restart
fi
fi
diff --git a/support-files/rpm/server-preun.sh b/support-files/rpm/server-preun.sh
index 7ef48f1c8d4..1d733a7d899 100644
--- a/support-files/rpm/server-preun.sh
+++ b/support-files/rpm/server-preun.sh
@@ -1,12 +1,16 @@
if [ $1 = 0 ] ; then
- # Stop MySQL before uninstalling it
- if [ -x %{_sysconfdir}/init.d/mysql ] ; then
- %{_sysconfdir}/init.d/mysql stop > /dev/null
- fi
+ # Stop MySQL before uninstalling it
# Don't start it automatically anymore
- if [ -x /sbin/chkconfig ] ; then
- /sbin/chkconfig --del mysql
- fi
+ if [ -x /usr/bin/systemctl ] ; then
+ /usr/bin/systemctl stop mariadb.service > /dev/null 2>&1
+ /usr/bin/systemctl disable mariadb.service > /dev/null 2>&1
+ fi
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql stop > /dev/null
+ fi
+ if [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --del mysql > /dev/null 2>&1
+ fi
fi
# We do not remove the mysql user since it may still own a lot of