mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
MDEV-295 Do NOT start mysql when installing MariaDB rpms
but restart it on upgrade, if it was already running
This commit is contained in:
parent
be0d1179a8
commit
108265bd9e
4 changed files with 15 additions and 23 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
7
support-files/rpm/server-postun.sh
Normal file
7
support-files/rpm/server-postun.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue