Commit c0ca3c4f authored by Alexey Bychko's avatar Alexey Bychko

MDEV-25240 minor upgrade does not perform server restart

we need to stop server instance on upgrade, but it may be started either by SysV init script or by SystemD.
this commit adds `mysql` target to `systemctl stop` call.
`mysql` may be the name of initscript or an alias while `mariadb` is
a systemd unit file.
parent 2fc76a50
if [ -r %{restart_flag} ] ; then
rm %{restart_flag}
# 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
if [ /usr/bin/systemctl is-active mysql ]; then
/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
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
%{_sysconfdir}/init.d/mysql restart > /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