1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-427/MDEV-5713 Add systemd script with notify functionality

This commit is contained in:
Daniel Black
2015-09-17 22:16:19 +10:00
committed by Sergey Vojtovich
parent 92271c78b6
commit 20c2ae39db
23 changed files with 551 additions and 15 deletions

View File

@ -21,6 +21,7 @@ mysqld_ld_library_path=
flush_caches=0
numa_interleave=0
wsrep_on=0
simulate=0
# Initial logging status: error log is not open, and not using syslog
logging=init
@ -81,6 +82,7 @@ Usage: $0 [OPTIONS]
--malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--simulate Simulate the start to detect errors but don't start
--nice=NICE Set the scheduling priority of mysqld
--no-auto-restart Exit after starting mysqld
--nowatch Exit after starting mysqld
@ -131,6 +133,7 @@ my_which ()
}
log_generic () {
[ $simulate -eq 1 ] && return
priority="$1"
shift
@ -318,6 +321,7 @@ parse_arguments() {
MYSQLD="mysqld"
fi
;;
--simulate) simulate=1 ;;
--nice=*) niceness="$val" ;;
--nowatch|--no[-_]watch|--no[-_]auto[-_]restart) nowatch=1 ;;
--open[-_]files[-_]limit=*) open_files="$val" ;;
@ -862,7 +866,7 @@ fi
#
# 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
if test -f "$pid_file"
if test -f "$pid_file" && [ $simulate -eq 0 ]
then
PID=`cat "$pid_file"`
if @CHECK_PID@
@ -937,7 +941,9 @@ fi
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
#fi
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
[ $simulate -eq 0 ] && cmd=''
#
# Set mysqld's memory interleave policy.
@ -957,7 +963,7 @@ then
fi
# Launch mysqld with numactl.
cmd="$cmd numactl --interleave=all"
[ $simulate -eq 0 ] && cmd="$cmd numactl --interleave=all"
elif test $numa_interleave -eq 1
then
log_error "--numa-interleave is not supported on this platform"
@ -971,6 +977,7 @@ do
done
cmd="$cmd $args"
# Avoid 'nohup: ignoring input' warning
[ $simulate -eq 0 ] && cmd='true'
test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
log_notice "Starting $MYSQLD daemon with databases from $DATADIR"