mirror of
https://github.com/MariaDB/server.git
synced 2025-10-12 12:25:37 +03:00
don't run SysV scripts in scriptlets if systemd is used
This commit is contained in:
@@ -17,9 +17,7 @@ fi
|
||||
if [ $1 = 1 ] ; then
|
||||
if [ -x /usr/bin/systemctl ] ; then
|
||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ -x /sbin/chkconfig ] ; then
|
||||
elif [ -x /sbin/chkconfig ] ; then
|
||||
/sbin/chkconfig --add mysql
|
||||
fi
|
||||
|
||||
|
@@ -1,11 +1,10 @@
|
||||
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
|
||||
fi
|
||||
|
||||
# only restart the server if it was alredy running
|
||||
if %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
|
||||
/usr/bin/systemctl try-restart mariadb.service > /dev/null 2>&1
|
||||
elif %{_sysconfdir}/init.d/mysql status > /dev/null 2>&1; then
|
||||
%{_sysconfdir}/init.d/mysql restart
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,12 +1,16 @@
|
||||
if [ $1 = 0 ] ; then
|
||||
# Stop MySQL before uninstalling it
|
||||
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
|
||||
%{_sysconfdir}/init.d/mysql stop > /dev/null
|
||||
fi
|
||||
# Stop MySQL before uninstalling it
|
||||
# Don't start it automatically anymore
|
||||
if [ -x /sbin/chkconfig ] ; then
|
||||
/sbin/chkconfig --del mysql
|
||||
fi
|
||||
if [ -x /usr/bin/systemctl ] ; then
|
||||
/usr/bin/systemctl stop mariadb.service > /dev/null 2>&1
|
||||
/usr/bin/systemctl disable mariadb.service > /dev/null 2>&1
|
||||
fi
|
||||
if [ -x %{_sysconfdir}/init.d/mysql ] ; then
|
||||
%{_sysconfdir}/init.d/mysql stop > /dev/null
|
||||
fi
|
||||
if [ -x /sbin/chkconfig ] ; then
|
||||
/sbin/chkconfig --del mysql > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
# We do not remove the mysql user since it may still own a lot of
|
||||
|
Reference in New Issue
Block a user