Commit 4975d253 authored by Sergei Golubchik's avatar Sergei Golubchik

don't run SysV scripts in scriptlets if systemd is used

parent 4a7d7e79
...@@ -17,9 +17,7 @@ fi ...@@ -17,9 +17,7 @@ fi
if [ $1 = 1 ] ; then if [ $1 = 1 ] ; then
if [ -x /usr/bin/systemctl ] ; then if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 /usr/bin/systemctl daemon-reload >/dev/null 2>&1
fi elif [ -x /sbin/chkconfig ] ; then
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql /sbin/chkconfig --add mysql
fi fi
......
if [ -r %{restart_flag} ] ; then if [ -r %{restart_flag} ] ; then
rm %{restart_flag} rm %{restart_flag}
# only restart the server if it was alredy running
if [ -x /usr/bin/systemctl ] ; then if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1 /usr/bin/systemctl daemon-reload > /dev/null 2>&1
fi /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
if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
%{_sysconfdir}/init.d/mysql restart %{_sysconfdir}/init.d/mysql restart
fi fi
fi fi
if [ $1 = 0 ] ; then if [ $1 = 0 ] ; then
# Stop MySQL before uninstalling it # Stop MySQL before uninstalling it
# Don't start it automatically anymore
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 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql stop > /dev/null %{_sysconfdir}/init.d/mysql stop > /dev/null
fi fi
# Don't start it automatically anymore
if [ -x /sbin/chkconfig ] ; then if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql /sbin/chkconfig --del mysql > /dev/null 2>&1
fi fi
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment