Commit 108265bd authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-295 Do NOT start mysql when installing MariaDB rpms

but restart it on upgrade, if it was already running
parent be0d1179
......@@ -4,8 +4,10 @@ mysql_datadir=%{mysqldatadir}
mkdir -p $mysql_datadir/{mysql,test}
# Make MySQL start/shutdown automatically when the machine does it.
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
if [ $1 = 1 ] ; then
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
fi
fi
# Create a MySQL user and group. Do not report any problems if it already
......@@ -65,13 +67,3 @@ if [ -x sbin/restorecon ] ; then
sbin/restorecon -R var/lib/mysql
fi
# Restart in the same way that mysqld will be started normally.
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql start
echo "Giving mysqld 2 seconds to start"
sleep 2
fi
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2
if [ $1 -ge 1 ]; then
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
# only restart the server if it was alredy running
%{_sysconfdir}/init.d/mysql status > /dev/null 2>&1 && \
%{_sysconfdir}/init.d/mysql restart
fi
fi
......@@ -64,10 +64,3 @@ HERE
fi
fi
# Shut down a previously installed server first
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
echo "Giving mysqld 5 seconds to exit nicely"
sleep 5
fi
......@@ -2,10 +2,10 @@ if [ $1 = 0 ] ; then
# Stop MySQL before uninstalling it
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
%{_sysconfdir}/init.d/mysql stop > /dev/null
# Don't start it automatically anymore
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql
fi
fi
# Don't start it automatically anymore
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql
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