2018-09-08 19:42:53 +02:00
|
|
|
if [ -r %{restart_flag} ] ; then
|
|
|
|
rm %{restart_flag}
|
2021-03-31 09:47:14 +03:00
|
|
|
# only restart the server if it was already running
|
2018-09-08 19:42:53 +02:00
|
|
|
if [ -x /usr/bin/systemctl ] ; then
|
|
|
|
/usr/bin/systemctl daemon-reload > /dev/null 2>&1
|
2021-05-13 17:54:15 +02:00
|
|
|
if /usr/bin/systemctl is-active mysql; then
|
2021-03-26 18:01:10 +07:00
|
|
|
/usr/bin/systemctl restart mysql > /dev/null 2>&1
|
|
|
|
else
|
|
|
|
/usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
# not a systemd-enabled environment, use SysV startup script
|
2019-03-22 01:55:35 +01:00
|
|
|
elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
|
2021-03-26 18:01:10 +07:00
|
|
|
%{_sysconfdir}/init.d/mysql restart > /dev/null 2>&1
|
2018-09-08 19:42:53 +02:00
|
|
|
fi
|
|
|
|
fi
|