diff --git a/community-mysql.spec b/community-mysql.spec index 88fbb02..cb4e659 100644 --- a/community-mysql.spec +++ b/community-mysql.spec @@ -897,18 +897,38 @@ popd -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : %post server +%if %{with init_systemd} %systemd_post %{daemon_name}.service +%endif +%if %{with init_sysv} +if [ $1 = 1 ]; then + /sbin/chkconfig --add %{daemon_name} +fi +%endif if [ ! -e "%{logfile}" -a ! -h "%{logfile}" ] ; then install /dev/null -m0640 -omysql -gmysql "%{logfile}" fi %preun server +%if %{with init_systemd} %systemd_preun %{daemon_name}.service +%endif +%if %{with init_sysv} +if [ $1 = 0 ]; then + /sbin/service %{daemon_name} stop >/dev/null 2>&1 + /sbin/chkconfig --del %{daemon_name} +fi +%endif %postun server +%if %{with init_systemd} %systemd_postun_with_restart %{daemon_name}.service - - +%endif +%if %{with init_sysv} +if [ $1 -ge 1 ]; then + /sbin/service %{daemon_name} condrestart >/dev/null 2>&1 || : +fi +%endif %if %{with client} %files