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

After review/QA fixes.
This commit is contained in:
Sergey Vojtovich
2015-09-28 15:08:09 +04:00
parent 20c2ae39db
commit 6346d1de2f
19 changed files with 164 additions and 113 deletions

View File

@ -21,7 +21,7 @@ mysqld_ld_library_path=
flush_caches=0
numa_interleave=0
wsrep_on=0
simulate=0
dry_run=0
# Initial logging status: error log is not open, and not using syslog
logging=init
@ -82,7 +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
--dry-run 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
@ -133,7 +133,7 @@ my_which ()
}
log_generic () {
[ $simulate -eq 1 ] && return
[ $dry_run -eq 1 ] && return
priority="$1"
shift
@ -321,7 +321,7 @@ parse_arguments() {
MYSQLD="mysqld"
fi
;;
--simulate) simulate=1 ;;
--dry[-_]run) dry_run=1 ;;
--nice=*) niceness="$val" ;;
--nowatch|--no[-_]watch|--no[-_]auto[-_]restart) nowatch=1 ;;
--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
# 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
PID=`cat "$pid_file"`
if @CHECK_PID@
@ -941,9 +941,8 @@ 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=''
[ $dry_run -eq 1 ] && cmd=''
#
# Set mysqld's memory interleave policy.
@ -963,7 +962,7 @@ then
fi
# 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
then
log_error "--numa-interleave is not supported on this platform"
@ -976,8 +975,8 @@ do
cmd="$cmd "`shell_quote_string "$i"`
done
cmd="$cmd $args"
[ $dry_run -eq 1 ] && return
# 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"