summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/CMakeLists.txt2
-rwxr-xr-xscripts/mariadb-service-convert18
-rw-r--r--scripts/mysqld_safe.sh17
3 files changed, 16 insertions, 21 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index e0c25ba9829..eb780169324 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -300,7 +300,7 @@ ELSE()
mysqld_multi
mysqld_safe
${WSREP_BINARIES}
- mariadb-service-convert
+ ${SYSTEMD_SCRIPTS}
)
FOREACH(file ${BIN_SCRIPTS})
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
diff --git a/scripts/mariadb-service-convert b/scripts/mariadb-service-convert
index 78bf7269f70..3f241d13107 100755
--- a/scripts/mariadb-service-convert
+++ b/scripts/mariadb-service-convert
@@ -25,14 +25,7 @@
tz_old=$TZ
-get_params()
-{
-# does a return so needs to be wrapped in a function
-# . /usr/bin/mysqld_safe --simulate
- . scripts/mysqld_safe --simulate
-}
-
-get_params
+. /usr/bin/mysqld_safe --dry-run
echo "# converted using $0"
echo "#"
@@ -66,10 +59,11 @@ if [ -n "$mysqld_ld_library_path" ]; then
fi
if [[ $want_syslog -eq 1 ]]; then
+ echo StandardOutput=syslog
echo StandardError=syslog
echo SyslogFacility=daemon
- echo SyslogLevel=error
- echo SyslogLevelPrefix=${syslog_tag_mysqld}
+ echo SyslogLevel=err
+ echo SyslogIdentifier=${syslog_tag_mysqld}
fi
if [[ "${flush_caches}" -gt 0 ]]; then
@@ -83,4 +77,6 @@ if [[ "${numa_interleave}" -gt 0 ]]; then
echo
fi
-[ -n "${CRASH_SCRIPT}" ] && echo FailureAction=${CRASH_SCRIPT}
+if [ -n "${CRASH_SCRIPT}" ]; then
+ echo FailureAction=${CRASH_SCRIPT}
+fi
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"