mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-427/MDEV-5713 Add systemd script with notify functionality
After review/QA fixes.
This commit is contained in:
@ -161,6 +161,7 @@ SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
|
|||||||
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
|
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
|
||||||
|
|
||||||
SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock")
|
SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock")
|
||||||
|
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
|
||||||
|
|
||||||
#
|
#
|
||||||
# DEB layout
|
# DEB layout
|
||||||
@ -189,6 +190,8 @@ SET(INSTALL_SUPPORTFILESDIR_DEB "share/mysql")
|
|||||||
SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql")
|
SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql")
|
||||||
|
|
||||||
SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
|
SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
|
||||||
|
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
|
||||||
|
|
||||||
#
|
#
|
||||||
# SVR4 layout
|
# SVR4 layout
|
||||||
#
|
#
|
||||||
@ -228,7 +231,8 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
|
|||||||
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
|
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
|
||||||
# layout is chosen)
|
# layout is chosen)
|
||||||
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF SYSCONF2
|
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF SYSCONF2
|
||||||
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA UNIX_ADDR)
|
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA UNIX_ADDR
|
||||||
|
SYSTEMD_UNIT)
|
||||||
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
|
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
|
||||||
CACHE STRING "${var} installation directory" ${FORCE})
|
CACHE STRING "${var} installation directory" ${FORCE})
|
||||||
MARK_AS_ADVANCED(INSTALL_${var}DIR)
|
MARK_AS_ADVANCED(INSTALL_${var}DIR)
|
||||||
|
@ -22,9 +22,9 @@ MACRO(CHECK_SYSTEMD)
|
|||||||
IF(WITH_SYSTEMD STREQUAL "yes" OR WITH_SYSTEMD STREQUAL "auto")
|
IF(WITH_SYSTEMD STREQUAL "yes" OR WITH_SYSTEMD STREQUAL "auto")
|
||||||
IF(PKG_CONFIG_FOUND)
|
IF(PKG_CONFIG_FOUND)
|
||||||
IF(WITH_SYSTEMD STREQUAL "yes")
|
IF(WITH_SYSTEMD STREQUAL "yes")
|
||||||
pkg_check_modules(LIBSYSTEMD REQUIRED libsystemd)
|
pkg_search_module(LIBSYSTEMD REQUIRED libsystemd libsystemd-daemon)
|
||||||
ELSE()
|
ELSE()
|
||||||
pkg_check_modules(LIBSYSTEMD libsystemd)
|
pkg_search_module(LIBSYSTEMD libsystemd libsystemd-daemon)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(HAVE_DLOPEN)
|
IF(HAVE_DLOPEN)
|
||||||
SET(LIBSYSTEMD ${LIBSYSTEMD_LIBRARIES})
|
SET(LIBSYSTEMD ${LIBSYSTEMD_LIBRARIES})
|
||||||
@ -51,17 +51,23 @@ MACRO(CHECK_SYSTEMD)
|
|||||||
CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS)
|
CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS)
|
||||||
CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY)
|
CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY)
|
||||||
CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF)
|
CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
|
IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
|
||||||
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
|
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
|
||||||
ADD_DEFINITIONS(-DHAVE_SYSTEMD)
|
ADD_DEFINITIONS(-DHAVE_SYSTEMD)
|
||||||
# should be from pkg-config --variable=systemdsystemconfdir systemd
|
SET(SYSTEMD_SCRIPTS mariadb-service-convert)
|
||||||
# Missing CMake macro: http://public.kitware.com/Bug/view.php?id=15634
|
SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert
|
||||||
SET(SYSTEMD_SYSTEM_CONFDIR /etc/systemd/system)
|
${INSTALL_SYSTEMD_UNITDIR}/mariadb.service
|
||||||
# should be from pkg-config --variable=systemdsystemunitdir systemd
|
${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service
|
||||||
SET(SYSTEMD_SYSTEM_UNITDIR /usr/lib/systemd/system/)
|
${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/wsrep-new-cluster.conf")
|
||||||
|
IF(DEB)
|
||||||
|
SET(SYSTEMD_EXECSTARTPRE "PermissionsStartOnly=true\nExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
|
||||||
|
SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start")
|
||||||
|
ENDIF()
|
||||||
MESSAGE(STATUS "Systemd features enabled")
|
MESSAGE(STATUS "Systemd features enabled")
|
||||||
ELSE()
|
ELSE()
|
||||||
UNSET(LIBSYSTEMD)
|
UNSET(LIBSYSTEMD)
|
||||||
|
UNSET(HAVE_SYSTEMD)
|
||||||
UNSET(HAVE_SYSTEMD_SD_DAEMON_H)
|
UNSET(HAVE_SYSTEMD_SD_DAEMON_H)
|
||||||
UNSET(HAVE_SYSTEMD_SD_LISTEN_FDS)
|
UNSET(HAVE_SYSTEMD_SD_LISTEN_FDS)
|
||||||
UNSET(HAVE_SYSTEMD_SD_NOTIFY)
|
UNSET(HAVE_SYSTEMD_SD_NOTIFY)
|
||||||
|
1
debian/control
vendored
1
debian/control
vendored
@ -23,7 +23,6 @@ Build-Depends: bison,
|
|||||||
zlib1g-dev (>= 1:1.1.3-5~),
|
zlib1g-dev (>= 1:1.1.3-5~),
|
||||||
${MAYBE_LIBCRACK}
|
${MAYBE_LIBCRACK}
|
||||||
libjemalloc-dev (>= 3.0.0~) [linux-any]
|
libjemalloc-dev (>= 3.0.0~) [linux-any]
|
||||||
libsystemd-daemon-dev | libsystemd-dev, dh-systemd
|
|
||||||
Standards-Version: 3.8.2
|
Standards-Version: 3.8.2
|
||||||
Homepage: http://mariadb.org/
|
Homepage: http://mariadb.org/
|
||||||
Vcs-Git: https://github.com/MariaDB/server.git
|
Vcs-Git: https://github.com/MariaDB/server.git
|
||||||
|
2
debian/mariadb-server-10.1.files.in
vendored
2
debian/mariadb-server-10.1.files.in
vendored
@ -55,7 +55,6 @@ usr/bin/wsrep_sst_mysqldump
|
|||||||
usr/bin/wsrep_sst_rsync
|
usr/bin/wsrep_sst_rsync
|
||||||
usr/bin/wsrep_sst_xtrabackup
|
usr/bin/wsrep_sst_xtrabackup
|
||||||
usr/bin/wsrep_sst_xtrabackup-v2
|
usr/bin/wsrep_sst_xtrabackup-v2
|
||||||
usr/bin/mariadb-system-convert
|
|
||||||
usr/share/doc/mariadb-server-10.1/mysqld.sym.gz
|
usr/share/doc/mariadb-server-10.1/mysqld.sym.gz
|
||||||
usr/share/doc/mariadb-server-10.1/INFO_SRC
|
usr/share/doc/mariadb-server-10.1/INFO_SRC
|
||||||
usr/share/doc/mariadb-server-10.1/INFO_BIN
|
usr/share/doc/mariadb-server-10.1/INFO_BIN
|
||||||
@ -94,3 +93,4 @@ usr/share/mysql/wsrep_notify
|
|||||||
@CASSANDRA_DEB_FILES@
|
@CASSANDRA_DEB_FILES@
|
||||||
@SPIDER_DEB_FILES@
|
@SPIDER_DEB_FILES@
|
||||||
@TOKUDB_DEB_FILES@
|
@TOKUDB_DEB_FILES@
|
||||||
|
@SYSTEMD_DEB_FILES@
|
||||||
|
6
debian/mariadb-server-10.1.postinst
vendored
6
debian/mariadb-server-10.1.postinst
vendored
@ -286,6 +286,12 @@ fi
|
|||||||
|
|
||||||
db_stop # in case invoke failes
|
db_stop # in case invoke failes
|
||||||
|
|
||||||
|
# dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mysql.
|
||||||
|
# Thus MariaDB server is started via init.d script, which in turn redirects to
|
||||||
|
# systemctl. If we upgrade from MySQL mysql.service may be masked, which also
|
||||||
|
# means init.d script is disabled. Unmask mysql service explicitely.
|
||||||
|
deb-systemd-helper unmask mysql.service >/dev/null || true
|
||||||
|
|
||||||
#DEBHELPER#
|
#DEBHELPER#
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
12
debian/rules
vendored
12
debian/rules
vendored
@ -180,12 +180,6 @@ install: build
|
|||||||
install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_SRC
|
install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_SRC
|
||||||
install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_BIN
|
install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.1/INFO_BIN
|
||||||
|
|
||||||
# systemd helpers
|
|
||||||
install -m 0755 scripts/mariadb-service-convert $(TMP)/usr/bin/
|
|
||||||
install -d $(TMP)/etc/systemd/system/mariadb@bootstrap.service.d/
|
|
||||||
install -m 0644 $(BUILDDIR)/support-files/mariadb-bootstrap.conf \
|
|
||||||
$(TMP)/etc/systemd/system/mariadb@bootstrap.service.d/wsrep-new-cluster.conf
|
|
||||||
|
|
||||||
# mariadb-test
|
# mariadb-test
|
||||||
mv $(TMP)/usr/mysql-test $(TMP)/usr/share/mysql
|
mv $(TMP)/usr/mysql-test $(TMP)/usr/share/mysql
|
||||||
|
|
||||||
@ -221,10 +215,7 @@ binary-indep: build install
|
|||||||
dh_installexamples -i
|
dh_installexamples -i
|
||||||
dh_installmenu -i
|
dh_installmenu -i
|
||||||
dh_installlogrotate -i
|
dh_installlogrotate -i
|
||||||
dh_systemd_enable -i support-files/mariadb.service
|
|
||||||
dh_systemd_enable --no-enable support-files/mariadb@.service
|
|
||||||
dh_installinit -i
|
dh_installinit -i
|
||||||
dh_systemd_start -i --restart-after-upgrade mariadb.service
|
|
||||||
dh_installcron -i
|
dh_installcron -i
|
||||||
dh_installman -i
|
dh_installman -i
|
||||||
dh_installinfo -i
|
dh_installinfo -i
|
||||||
@ -250,9 +241,12 @@ binary-arch: build install
|
|||||||
dh_installexamples -a
|
dh_installexamples -a
|
||||||
dh_installmenu -a
|
dh_installmenu -a
|
||||||
dh_installlogrotate -a --name mysql-server
|
dh_installlogrotate -a --name mysql-server
|
||||||
|
if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.1 mariadb.service; fi
|
||||||
|
if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.1 mariadb@.service; fi
|
||||||
# Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
|
# Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
|
||||||
# started which might depend on a running database server.
|
# started which might depend on a running database server.
|
||||||
dh_installinit -a --name=mysql -- defaults 19 21
|
dh_installinit -a --name=mysql -- defaults 19 21
|
||||||
|
if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.1/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.1 --restart-after-upgrade mariadb.service; fi
|
||||||
dh_installcron -a --name mysql-server
|
dh_installcron -a --name mysql-server
|
||||||
dh_installman -a
|
dh_installman -a
|
||||||
dh_installinfo -a
|
dh_installinfo -a
|
||||||
|
@ -1,17 +1,34 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2015 Daniel Black. All rights reserved.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef MY_SYSTEMD_INCLUDED
|
#ifndef MY_SYSTEMD_INCLUDED
|
||||||
#define MY_SYSTEMD_INCLUDED
|
#define MY_SYSTEMD_INCLUDED
|
||||||
|
|
||||||
#if defined(HAVE_SYSTEMD) && !defined(EMBEDDED_LIBRARY)
|
#if defined(HAVE_SYSTEMD) && !defined(EMBEDDED_LIBRARY)
|
||||||
|
/*
|
||||||
|
sd-daemon.h may include inttypes.h. Explicitly request format macros before
|
||||||
|
the first inclusion of inttypes.h.
|
||||||
|
*/
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
#include <systemd/sd-daemon.h>
|
#include <systemd/sd-daemon.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define sd_notify(X, Y)
|
#define sd_notify(X, Y)
|
||||||
#define sd_notifyf(E, F, ...)
|
#define sd_notifyf(E, F, ...)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MY_SYSTEMD_INCLUDED */
|
#endif /* MY_SYSTEMD_INCLUDED */
|
||||||
|
@ -300,7 +300,7 @@ ELSE()
|
|||||||
mysqld_multi
|
mysqld_multi
|
||||||
mysqld_safe
|
mysqld_safe
|
||||||
${WSREP_BINARIES}
|
${WSREP_BINARIES}
|
||||||
mariadb-service-convert
|
${SYSTEMD_SCRIPTS}
|
||||||
)
|
)
|
||||||
FOREACH(file ${BIN_SCRIPTS})
|
FOREACH(file ${BIN_SCRIPTS})
|
||||||
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
|
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
|
||||||
|
@ -25,14 +25,7 @@
|
|||||||
|
|
||||||
tz_old=$TZ
|
tz_old=$TZ
|
||||||
|
|
||||||
get_params()
|
. /usr/bin/mysqld_safe --dry-run
|
||||||
{
|
|
||||||
# does a return so needs to be wrapped in a function
|
|
||||||
# . /usr/bin/mysqld_safe --simulate
|
|
||||||
. scripts/mysqld_safe --simulate
|
|
||||||
}
|
|
||||||
|
|
||||||
get_params
|
|
||||||
|
|
||||||
echo "# converted using $0"
|
echo "# converted using $0"
|
||||||
echo "#"
|
echo "#"
|
||||||
@ -66,10 +59,11 @@ if [ -n "$mysqld_ld_library_path" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $want_syslog -eq 1 ]]; then
|
if [[ $want_syslog -eq 1 ]]; then
|
||||||
|
echo StandardOutput=syslog
|
||||||
echo StandardError=syslog
|
echo StandardError=syslog
|
||||||
echo SyslogFacility=daemon
|
echo SyslogFacility=daemon
|
||||||
echo SyslogLevel=error
|
echo SyslogLevel=err
|
||||||
echo SyslogLevelPrefix=${syslog_tag_mysqld}
|
echo SyslogIdentifier=${syslog_tag_mysqld}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${flush_caches}" -gt 0 ]]; then
|
if [[ "${flush_caches}" -gt 0 ]]; then
|
||||||
@ -83,4 +77,6 @@ if [[ "${numa_interleave}" -gt 0 ]]; then
|
|||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "${CRASH_SCRIPT}" ] && echo FailureAction=${CRASH_SCRIPT}
|
if [ -n "${CRASH_SCRIPT}" ]; then
|
||||||
|
echo FailureAction=${CRASH_SCRIPT}
|
||||||
|
fi
|
||||||
|
@ -21,7 +21,7 @@ mysqld_ld_library_path=
|
|||||||
flush_caches=0
|
flush_caches=0
|
||||||
numa_interleave=0
|
numa_interleave=0
|
||||||
wsrep_on=0
|
wsrep_on=0
|
||||||
simulate=0
|
dry_run=0
|
||||||
|
|
||||||
# Initial logging status: error log is not open, and not using syslog
|
# Initial logging status: error log is not open, and not using syslog
|
||||||
logging=init
|
logging=init
|
||||||
@ -82,7 +82,7 @@ Usage: $0 [OPTIONS]
|
|||||||
--malloc-lib=LIB Preload shared library LIB if available
|
--malloc-lib=LIB Preload shared library LIB if available
|
||||||
--mysqld=FILE Use the specified file as mysqld
|
--mysqld=FILE Use the specified file as mysqld
|
||||||
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
|
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
|
||||||
--simulate Simulate the start to detect errors but don't start
|
--dry-run Simulate the start to detect errors but don't start
|
||||||
--nice=NICE Set the scheduling priority of mysqld
|
--nice=NICE Set the scheduling priority of mysqld
|
||||||
--no-auto-restart Exit after starting mysqld
|
--no-auto-restart Exit after starting mysqld
|
||||||
--nowatch Exit after starting mysqld
|
--nowatch Exit after starting mysqld
|
||||||
@ -133,7 +133,7 @@ my_which ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
log_generic () {
|
log_generic () {
|
||||||
[ $simulate -eq 1 ] && return
|
[ $dry_run -eq 1 ] && return
|
||||||
priority="$1"
|
priority="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ parse_arguments() {
|
|||||||
MYSQLD="mysqld"
|
MYSQLD="mysqld"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
--simulate) simulate=1 ;;
|
--dry[-_]run) dry_run=1 ;;
|
||||||
--nice=*) niceness="$val" ;;
|
--nice=*) niceness="$val" ;;
|
||||||
--nowatch|--no[-_]watch|--no[-_]auto[-_]restart) nowatch=1 ;;
|
--nowatch|--no[-_]watch|--no[-_]auto[-_]restart) nowatch=1 ;;
|
||||||
--open[-_]files[-_]limit=*) open_files="$val" ;;
|
--open[-_]files[-_]limit=*) open_files="$val" ;;
|
||||||
@ -866,7 +866,7 @@ fi
|
|||||||
#
|
#
|
||||||
# If there exists an old pid file, check if the daemon is already running
|
# If there exists an old pid file, check if the daemon is already running
|
||||||
# Note: The switches to 'ps' may depend on your operating system
|
# Note: The switches to 'ps' may depend on your operating system
|
||||||
if test -f "$pid_file" && [ $simulate -eq 0 ]
|
if test -f "$pid_file" && [ $dry_run -eq 0 ]
|
||||||
then
|
then
|
||||||
PID=`cat "$pid_file"`
|
PID=`cat "$pid_file"`
|
||||||
if @CHECK_PID@
|
if @CHECK_PID@
|
||||||
@ -941,9 +941,8 @@ fi
|
|||||||
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
|
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
|
|
||||||
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
|
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
|
||||||
[ $simulate -eq 0 ] && cmd=''
|
[ $dry_run -eq 1 ] && cmd=''
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set mysqld's memory interleave policy.
|
# Set mysqld's memory interleave policy.
|
||||||
@ -963,7 +962,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Launch mysqld with numactl.
|
# Launch mysqld with numactl.
|
||||||
[ $simulate -eq 0 ] && cmd="$cmd numactl --interleave=all"
|
[ $dry_run -eq 0 ] && cmd="$cmd numactl --interleave=all"
|
||||||
elif test $numa_interleave -eq 1
|
elif test $numa_interleave -eq 1
|
||||||
then
|
then
|
||||||
log_error "--numa-interleave is not supported on this platform"
|
log_error "--numa-interleave is not supported on this platform"
|
||||||
@ -976,8 +975,8 @@ do
|
|||||||
cmd="$cmd "`shell_quote_string "$i"`
|
cmd="$cmd "`shell_quote_string "$i"`
|
||||||
done
|
done
|
||||||
cmd="$cmd $args"
|
cmd="$cmd $args"
|
||||||
|
[ $dry_run -eq 1 ] && return
|
||||||
# Avoid 'nohup: ignoring input' warning
|
# Avoid 'nohup: ignoring input' warning
|
||||||
[ $simulate -eq 0 ] && cmd='true'
|
|
||||||
test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
|
test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
|
||||||
|
|
||||||
log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
|
log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
|
||||||
|
@ -1893,8 +1893,6 @@ static void __cdecl kill_server(int sig_ptr)
|
|||||||
else
|
else
|
||||||
sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
|
sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
|
||||||
|
|
||||||
sd_notify(0, "STOPPING=1");
|
|
||||||
|
|
||||||
#ifdef HAVE_SMEM
|
#ifdef HAVE_SMEM
|
||||||
/*
|
/*
|
||||||
Send event to smem_event_connect_request for aborting
|
Send event to smem_event_connect_request for aborting
|
||||||
@ -2001,6 +1999,7 @@ void unireg_end(void)
|
|||||||
{
|
{
|
||||||
clean_up(1);
|
clean_up(1);
|
||||||
my_thread_end();
|
my_thread_end();
|
||||||
|
sd_notify(0, "STATUS=MariaDB server is down");
|
||||||
#if defined(SIGNALS_DONT_BREAK_READ)
|
#if defined(SIGNALS_DONT_BREAK_READ)
|
||||||
exit(0);
|
exit(0);
|
||||||
#else
|
#else
|
||||||
@ -2066,6 +2065,7 @@ static void mysqld_exit(int exit_code)
|
|||||||
shutdown_performance_schema(); // we do it as late as possible
|
shutdown_performance_schema(); // we do it as late as possible
|
||||||
#endif
|
#endif
|
||||||
DBUG_LEAVE;
|
DBUG_LEAVE;
|
||||||
|
sd_notify(0, "STATUS=MariaDB server is down");
|
||||||
exit(exit_code); /* purecov: inspected */
|
exit(exit_code); /* purecov: inspected */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6547,10 +6547,8 @@ void handle_connections_sockets()
|
|||||||
socket_flags=fcntl(mysql_socket_getfd(unix_sock), F_GETFL, 0);
|
socket_flags=fcntl(mysql_socket_getfd(unix_sock), F_GETFL, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
|
||||||
sd_notify(0, "READY=1\n"
|
sd_notify(0, "READY=1\n"
|
||||||
"STATUS=Taking your SQL requests now...");
|
"STATUS=Taking your SQL requests now...");
|
||||||
#endif
|
|
||||||
|
|
||||||
DBUG_PRINT("general",("Waiting for connections."));
|
DBUG_PRINT("general",("Waiting for connections."));
|
||||||
MAYBE_BROKEN_SYSCALL;
|
MAYBE_BROKEN_SYSCALL;
|
||||||
@ -6766,7 +6764,8 @@ void handle_connections_sockets()
|
|||||||
create_new_thread(thd);
|
create_new_thread(thd);
|
||||||
set_current_thd(0);
|
set_current_thd(0);
|
||||||
}
|
}
|
||||||
sd_notify(0, "STOPPING=1");
|
sd_notify(0, "STOPPING=1\n"
|
||||||
|
"STATUS=Shutdown in progress");
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1874,15 +1874,16 @@ loop:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
progress=(ulong) (i * 100) / hash_get_n_cells(recv_sys->addr_hash);
|
progress = (ulong) (i * 100)
|
||||||
|
/ hash_get_n_cells(recv_sys->addr_hash);
|
||||||
if (has_printed
|
if (has_printed
|
||||||
&& progress != ((i + 1) * 100)
|
&& progress
|
||||||
/ hash_get_n_cells(recv_sys->addr_hash)) {
|
!= ((i + 1) * 100)
|
||||||
|
/ hash_get_n_cells(recv_sys->addr_hash)) {
|
||||||
|
|
||||||
fprintf(stderr, "%lu ", progress);
|
fprintf(stderr, "%lu ", progress);
|
||||||
sd_notifyf(0, "STATUS=Applying batch of log records for Innodb: "
|
sd_notifyf(0, "STATUS=Applying batch of log records for"
|
||||||
"Progress %lu", progress);
|
" InnoDB: Progress %lu", progress);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2094,8 +2095,9 @@ skip_this_recv_addr:
|
|||||||
fprintf(stderr, "%lu ",
|
fprintf(stderr, "%lu ",
|
||||||
(ulong) ((100 * i) / n_hash_cells));
|
(ulong) ((100 * i) / n_hash_cells));
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
sd_notifyf(0, "STATUS=Applying batch of log records for backup Innodb: "
|
sd_notifyf(0, "STATUS=Applying batch of log records for"
|
||||||
"Progress %lu", (ulong) (100 * i) / n_hash_cells);
|
" backup InnoDB: Progress %lu",
|
||||||
|
(ulong) (100 * i) / n_hash_cells);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sd_notify(0, "STATUS=InnoDB: Apply batch for backup completed");
|
sd_notify(0, "STATUS=InnoDB: Apply batch for backup completed");
|
||||||
|
@ -1942,15 +1942,16 @@ loop:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
progress=(ulong) (i * 100) / hash_get_n_cells(recv_sys->addr_hash);
|
progress = (ulong) (i * 100)
|
||||||
|
/ hash_get_n_cells(recv_sys->addr_hash);
|
||||||
if (has_printed
|
if (has_printed
|
||||||
&& progress != ((i + 1) * 100)
|
&& progress
|
||||||
/ hash_get_n_cells(recv_sys->addr_hash)) {
|
!= ((i + 1) * 100)
|
||||||
|
/ hash_get_n_cells(recv_sys->addr_hash)) {
|
||||||
fprintf(stderr, "%lu ", progress);
|
|
||||||
sd_notifyf(0, "STATUS=Applying batch of log records for Innodb: "
|
|
||||||
"Progress %lu", progress);
|
|
||||||
|
|
||||||
|
fprintf(stderr, "%lu ", progress);
|
||||||
|
sd_notifyf(0, "STATUS=Applying batch of log records for"
|
||||||
|
" InnoDB: Progress %lu", progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2164,8 +2165,9 @@ skip_this_recv_addr:
|
|||||||
fprintf(stderr, "%lu ",
|
fprintf(stderr, "%lu ",
|
||||||
(ulong) ((100 * i) / n_hash_cells));
|
(ulong) ((100 * i) / n_hash_cells));
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
sd_notifyf(0, "STATUS=Applying batch of log records for backup Innodb: "
|
sd_notifyf(0, "STATUS=Applying batch of log records for"
|
||||||
"Progress %lu", (ulong) (100 * i) / n_hash_cells);
|
" backup InnoDB: Progress %lu",
|
||||||
|
(ulong) (100 * i) / n_hash_cells);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sd_notify(0, "STATUS=InnoDB: Apply batch for backup completed");
|
sd_notify(0, "STATUS=InnoDB: Apply batch for backup completed");
|
||||||
|
@ -76,23 +76,35 @@ IF(UNIX)
|
|||||||
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
|
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
|
||||||
DESTINATION ${inst_location} COMPONENT SupportFiles)
|
DESTINATION ${inst_location} COMPONENT SupportFiles)
|
||||||
|
|
||||||
IF(SYSTEMD_SYSTEM_UNITDIR)
|
IF(HAVE_SYSTEMD)
|
||||||
CONFIGURE_FILE(mariadb@.service.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service @ONLY)
|
CONFIGURE_FILE(mariadb.service.in
|
||||||
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
|
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service @ONLY)
|
||||||
# http://public.kitware.com/Bug/view.php?id=14782
|
IF(NOT RPM)
|
||||||
INSTALL(FILES
|
CONFIGURE_FILE(mariadb@.service.in
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/mariadb-bootstrap.conf
|
${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service @ONLY)
|
||||||
DESTINATION "${SYSTEMD_SYSTEM_UNITDIR}/mariadb@bootstrap.service.d" COMPONENT Server
|
INSTALL(FILES wsrep-new-cluster.conf
|
||||||
)
|
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
|
||||||
INSTALL(FILES
|
${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service
|
DESTINATION ${inst_location}/systemd COMPONENT SupportFiles)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/mariadb.service
|
ENDIF()
|
||||||
DESTINATION ${SYSTEMD_SYSTEM_UNITDIR} COMPONENT Server
|
IF(INSTALL_SYSTEMD_UNITDIR)
|
||||||
)
|
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
|
||||||
|
# http://public.kitware.com/Bug/view.php?id=14782
|
||||||
|
IF(NOT RPM)
|
||||||
|
INSTALL(FILES wsrep-new-cluster.conf
|
||||||
|
DESTINATION
|
||||||
|
"${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d"
|
||||||
|
COMPONENT Server)
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service
|
||||||
|
DESTINATION ${INSTALL_SYSTEMD_UNITDIR} COMPONENT Server)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
|
||||||
|
DESTINATION ${INSTALL_SYSTEMD_UNITDIR} COMPONENT Server)
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (INSTALL_SYSCONFDIR)
|
IF (INSTALL_SYSCONFDIR)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate DESTINATION ${INSTALL_SYSCONFDIR}/logrotate.d
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate DESTINATION ${INSTALL_SYSCONFDIR}/logrotate.d
|
||||||
RENAME mysql COMPONENT SupportFiles)
|
RENAME mysql COMPONENT SupportFiles)
|
||||||
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
|
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
|
||||||
|
@ -32,6 +32,7 @@ Alias=mysqld.service
|
|||||||
Type=notify
|
Type=notify
|
||||||
|
|
||||||
# Setting this to true can break replication and the Type=notify settings
|
# Setting this to true can break replication and the Type=notify settings
|
||||||
|
# See also bind-address mysqld option.
|
||||||
PrivateNetwork=false
|
PrivateNetwork=false
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -39,6 +40,7 @@ PrivateNetwork=false
|
|||||||
##
|
##
|
||||||
|
|
||||||
User=mysql
|
User=mysql
|
||||||
|
Group=mysql
|
||||||
|
|
||||||
# Execute pre and post scripts as root, otherwise it does it as User=
|
# Execute pre and post scripts as root, otherwise it does it as User=
|
||||||
# PermissionsStartOnly=true
|
# PermissionsStartOnly=true
|
||||||
@ -47,10 +49,12 @@ User=mysql
|
|||||||
# ExecStartPre=/usr/bin/mysql_install_db
|
# ExecStartPre=/usr/bin/mysql_install_db
|
||||||
|
|
||||||
# Start main service
|
# Start main service
|
||||||
# EXTRA_ARGS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
|
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
|
||||||
# Use the [service] section and Environment="EXTRA_ARGS=...".
|
# Use the [service] section and Environment="MYSQLD_OPTS=...".
|
||||||
# This isn't a replacement for my.cnf.
|
# This isn't a replacement for my.cnf.
|
||||||
ExecStart=/usr/sbin/mysqld $EXTRA_ARGS
|
@SYSTEMD_EXECSTARTPRE@
|
||||||
|
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS
|
||||||
|
@SYSTEMD_EXECSTARTPOST@
|
||||||
|
|
||||||
KillMode=process
|
KillMode=process
|
||||||
KillSignal=SIGTERM
|
KillSignal=SIGTERM
|
||||||
@ -58,14 +62,12 @@ KillSignal=SIGTERM
|
|||||||
# Don't want to see an automated SIGKILL ever
|
# Don't want to see an automated SIGKILL ever
|
||||||
SendSIGKILL=no
|
SendSIGKILL=no
|
||||||
|
|
||||||
# Exit status 1 is a fatal config error. Restarting won't help.
|
# Restart crashed server only, on-failure would also restart, for example, when
|
||||||
RestartPreventExitStatus=1
|
# my.cnf contains unknown option
|
||||||
Restart=on-failure
|
Restart=on-abort
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
|
|
||||||
PrivateDevices=true
|
UMask=007
|
||||||
|
|
||||||
UMask=077
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
## USERs can override
|
## USERs can override
|
||||||
@ -78,10 +80,10 @@ UMask=077
|
|||||||
|
|
||||||
# Kernels like killing mysqld when out of memory because its big.
|
# Kernels like killing mysqld when out of memory because its big.
|
||||||
# Lets temper that preference a little.
|
# Lets temper that preference a little.
|
||||||
OOMScoreAdjust=-600
|
# OOMScoreAdjust=-600
|
||||||
|
|
||||||
# Explicitly start with high IO priority
|
# Explicitly start with high IO priority
|
||||||
BlockIOWeight=1000
|
# BlockIOWeight=1000
|
||||||
|
|
||||||
# If you don't use the /tmp directory for SELECT ... OUTFILE and
|
# If you don't use the /tmp directory for SELECT ... OUTFILE and
|
||||||
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
|
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
|
||||||
@ -94,7 +96,7 @@ PrivateTmp=false
|
|||||||
##
|
##
|
||||||
|
|
||||||
# Number of files limit. previously [mysqld_safe] open-file-limit
|
# Number of files limit. previously [mysqld_safe] open-file-limit
|
||||||
LimitNOFILE=16364
|
# LimitNOFILE=16364
|
||||||
|
|
||||||
# Maximium core size. previously [mysqld_safe] core-file-size
|
# Maximium core size. previously [mysqld_safe] core-file-size
|
||||||
# LimitCore=
|
# LimitCore=
|
@ -39,6 +39,7 @@ Alias=mysqld.service
|
|||||||
Type=notify
|
Type=notify
|
||||||
|
|
||||||
# Setting this to true can break replication and the Type=notify settings
|
# Setting this to true can break replication and the Type=notify settings
|
||||||
|
# See also bind-address mysqld option.
|
||||||
PrivateNetwork=false
|
PrivateNetwork=false
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -46,6 +47,7 @@ PrivateNetwork=false
|
|||||||
##
|
##
|
||||||
|
|
||||||
User=mysql
|
User=mysql
|
||||||
|
Group=mysql
|
||||||
|
|
||||||
# Execute pre and post scripts as root, otherwise it does it as User=
|
# Execute pre and post scripts as root, otherwise it does it as User=
|
||||||
# PermissionsStartOnly=true
|
# PermissionsStartOnly=true
|
||||||
@ -54,16 +56,16 @@ User=mysql
|
|||||||
# ExecStartPre=/usr/bin/mysql_install_db
|
# ExecStartPre=/usr/bin/mysql_install_db
|
||||||
|
|
||||||
# Start main service
|
# Start main service
|
||||||
# EXTRA_ARGS here is for users to set in /etc/systemd/system/mariadb@.service.d/MY_SPECIAL.conf
|
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb@.service.d/MY_SPECIAL.conf
|
||||||
# Use the [service] section and Environment="EXTRA_ARGS=...".
|
# Use the [service] section and Environment="MYSQLD_OPTS=...".
|
||||||
# This isn't a replacement for my.cnf.
|
# This isn't a replacement for my.cnf.
|
||||||
|
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=/usr/sbin/mysqld $EXTRA_ARGS --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf
|
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf
|
||||||
# Alternate: (remove ConditionPathExists above)
|
# Alternate: (remove ConditionPathExists above)
|
||||||
# use [mysqld.INSTANCENAME] as sections in my.cnf
|
# use [mysqld.INSTANCENAME] as sections in my.cnf
|
||||||
#
|
#
|
||||||
# ExecStart=/usr/sbin/mysqld $EXTRA_ARGS --defaults-group-suffix=%I
|
# ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --defaults-group-suffix=%I
|
||||||
|
|
||||||
KillMode=process
|
KillMode=process
|
||||||
KillSignal=SIGTERM
|
KillSignal=SIGTERM
|
||||||
@ -71,14 +73,12 @@ KillSignal=SIGTERM
|
|||||||
# Don't want to see an automated SIGKILL ever
|
# Don't want to see an automated SIGKILL ever
|
||||||
SendSIGKILL=no
|
SendSIGKILL=no
|
||||||
|
|
||||||
# Exit status 1 is a fatal config error. Restarting won't help.
|
# Restart crashed server only, on-failure would also restart, for example, when
|
||||||
RestartPreventExitStatus=1
|
# my.cnf contains unknown option
|
||||||
Restart=on-failure
|
Restart=on-abort
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
|
|
||||||
PrivateDevices=true
|
UMask=007
|
||||||
|
|
||||||
UMask=077
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
## USERs can override
|
## USERs can override
|
||||||
@ -91,10 +91,10 @@ UMask=077
|
|||||||
|
|
||||||
# Kernels like killing mysqld when out of memory because its big.
|
# Kernels like killing mysqld when out of memory because its big.
|
||||||
# Lets temper that preference a little.
|
# Lets temper that preference a little.
|
||||||
OOMScoreAdjust=-600
|
# OOMScoreAdjust=-600
|
||||||
|
|
||||||
# Explicitly start with high IO priority
|
# Explicitly start with high IO priority
|
||||||
BlockIOWeight=1000
|
# BlockIOWeight=1000
|
||||||
|
|
||||||
# If you don't use the /tmp directory for SELECT ... OUTFILE and
|
# If you don't use the /tmp directory for SELECT ... OUTFILE and
|
||||||
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
|
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
|
||||||
@ -107,7 +107,7 @@ PrivateTmp=false
|
|||||||
##
|
##
|
||||||
|
|
||||||
# Number of files limit. previously [mysqld_safe] open-file-limit
|
# Number of files limit. previously [mysqld_safe] open-file-limit
|
||||||
LimitNOFILE=16364
|
# LimitNOFILE=16364
|
||||||
|
|
||||||
# Maximium core size. previously [mysqld_safe] core-file-size
|
# Maximium core size. previously [mysqld_safe] core-file-size
|
||||||
# LimitCore=
|
# LimitCore=
|
||||||
|
@ -97,6 +97,11 @@ lsb_functions="/lib/lsb/init-functions"
|
|||||||
if test -f $lsb_functions ; then
|
if test -f $lsb_functions ; then
|
||||||
. $lsb_functions
|
. $lsb_functions
|
||||||
else
|
else
|
||||||
|
# Include non-LSB RedHat init functions to make systemctl redirect work
|
||||||
|
init_functions="/etc/init.d/functions"
|
||||||
|
if test -f $init_functions; then
|
||||||
|
. $init_functions
|
||||||
|
fi
|
||||||
log_success_msg()
|
log_success_msg()
|
||||||
{
|
{
|
||||||
echo " SUCCESS! $@"
|
echo " SUCCESS! $@"
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
|
if [ -f /usr/lib/systemd/system/mariadb.service -a -x /usr/bin/systemctl ]; then
|
||||||
|
systemd_conf=/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
|
||||||
|
if [ -x %{_bindir}/mariadb-service-convert -a ! -f "${systemd_conf}" ]; then
|
||||||
|
# Either fresh install or upgrade non-systemd -> systemd
|
||||||
|
mkdir -p /etc/systemd/system/mariadb.service.d
|
||||||
|
%{_bindir}/mariadb-service-convert > "${systemd_conf}"
|
||||||
|
# Make sure old possibly non-systemd instance is down
|
||||||
|
if [ $1 = 2 ]; then
|
||||||
|
SYSTEMCTL_SKIP_REDIRECT=1 %{_sysconfdir}/init.d/mysql stop >/dev/null 2>&1 || :
|
||||||
|
systemctl start mariadb >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
systemctl enable mariadb.service >/dev/null 2>&1 || :
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Make MySQL start/shutdown automatically when the machine does it.
|
# Make MySQL start/shutdown automatically when the machine does it.
|
||||||
if [ $1 = 1 ] ; then
|
if [ $1 = 1 ] ; then
|
||||||
systemd_conf=/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
|
|
||||||
if [ -x /usr/bin/mariadb-service-convert -a ! -f "${systemd_conf}" ]; then
|
|
||||||
mkdir -p /etc/systemd/system/mariadb.service.d
|
|
||||||
/usr/bin/mariadb-service-convert > "${systemd_conf}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x /usr/bin/systemctl ] ; then
|
if [ -x /usr/bin/systemctl ] ; then
|
||||||
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
|
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
@ -12,5 +12,5 @@ ConditionPathExists=
|
|||||||
|
|
||||||
# Override the multi instance service for a bootstrap start instance
|
# Override the multi instance service for a bootstrap start instance
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=/usr/sbin/mysqld $EXTRA_ARGS --wsrep-new-cluster
|
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --wsrep-new-cluster
|
||||||
|
|
Reference in New Issue
Block a user