summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-09-28 15:08:09 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-10-12 17:51:49 +0200
commit6346d1de2fdaa8a8359082871eac49402cb0e472 (patch)
tree62a057a2b8ab0b24bc242461522017e333fe741f /scripts/mysqld_safe.sh
parent20c2ae39db3dd0ec4c337a9b0bd2bf4481b61e49 (diff)
downloadmariadb-git-6346d1de2fdaa8a8359082871eac49402cb0e472.tar.gz
MDEV-427/MDEV-5713 Add systemd script with notify functionality
After review/QA fixes.
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 1973e354281..13206ce0e56 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -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"