Commit 932e29d4 authored by Sergei Golubchik's avatar Sergei Golubchik

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

parent bfb0726f
......@@ -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
......
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
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
fi
if [ $1 = 0 ] ; then
......
if [ $1 = 0 ] ; then
# 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
%{_sysconfdir}/init.d/mysql stop > /dev/null
fi
# Don't start it automatically anymore
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql
/sbin/chkconfig --del mysql > /dev/null 2>&1
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