diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-03-22 01:55:35 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-04-24 16:06:54 +0200 |
commit | 932e29d4ad3cd6ffb445f0080191c88c8b2693c0 (patch) | |
tree | 8af7971d8a8d9ff8beb0fda719f51e18f468eb44 /support-files | |
parent | bfb0726fc24acb896e54bc7ef7536ad1aab9d574 (diff) | |
download | mariadb-git-932e29d4ad3cd6ffb445f0080191c88c8b2693c0.tar.gz |
don't run SysV scripts in scriptlets if systemd is used
Diffstat (limited to 'support-files')
-rw-r--r-- | support-files/rpm/server-postin.sh | 4 | ||||
-rw-r--r-- | support-files/rpm/server-postun.sh | 11 | ||||
-rw-r--r-- | support-files/rpm/server-preun.sh | 18 |
3 files changed, 18 insertions, 15 deletions
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh index 08b046dc272..ad783812184 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 diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index 412c6f4c67b..21468e39e18 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -1,9 +1,10 @@ if [ $1 -ge 1 ]; then - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - # only restart the server if it was alredy running - if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then - %{_sysconfdir}/init.d/mysql restart - fi + # only restart the server if it was alredy running + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 + /usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1 + elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then + %{_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 |