From e094bad5262df47eec4f8d6349d1a20c84a92a87 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Thu, 13 Jul 2017 16:38:43 +0200 Subject: [PATCH] physical remove for previsou commit --- mysql-wait-ready.sh | 45 --------------------------------------------- mysql-wait-stop.sh | 36 ------------------------------------ 2 files changed, 81 deletions(-) delete mode 100644 mysql-wait-ready.sh delete mode 100644 mysql-wait-stop.sh diff --git a/mysql-wait-ready.sh b/mysql-wait-ready.sh deleted file mode 100644 index 2ed5fe1..0000000 --- a/mysql-wait-ready.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" - -# This script waits for mysqld to be ready to accept connections -# (which can be many seconds or even minutes after launch, if there's -# a lot of crash-recovery work to do). -# Running this as ExecStartPost is useful so that services declared as -# "After mysqld" won't be started until the database is really ready. - -if [ $# -ne 1 ] ; then - echo "You need to pass daemon pid as an argument for this script." - exit 20 -fi - -# Service file passes us the daemon's PID (actually, mysqld_safe's PID) -daemon_pid="$1" - -# Wait for the server to come up or for the mysqld process to disappear -ret=0 -while /bin/true; do - # Check process still exists - if ! [ -d "/proc/${daemon_pid}" ] ; then - ret=1 - break - fi - RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` - mret=$? - if [ $mret -eq 0 ] ; then - break - fi - # exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected, - # anything else suggests a configuration error - if [ $mret -ne 1 -a $mret -ne 11 ]; then - echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2 - ret=$mret - break - fi - # "Access denied" also means the server is alive - echo "$RESPONSE" | grep -q "Access denied for user" && break - - sleep 1 -done - -exit $ret diff --git a/mysql-wait-stop.sh b/mysql-wait-stop.sh deleted file mode 100644 index 62bde30..0000000 --- a/mysql-wait-stop.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" - -# This script waits for mysqld to be properly stopped -# (which can be many seconds in some large load). -# Running this as ExecStopPost is useful so that starting which is done -# as part of restart doesn't see the former process still running. - -# Wait for the server to properly end the main server -ret=0 -TIMEOUT=60 -SECONDS=0 - -if ! [ -f "$pidfile" ]; then - exit 0 -fi - -MYSQLPID=`cat "$pidfile" 2>/dev/null` -if [ -z "$MYSQLPID" ] ; then - exit 2 -fi - -while /bin/true; do - # Check process still exists - if ! [ -d "/proc/${MYSQLPID}" ] ; then - break - fi - if [ $SECONDS -gt $TIMEOUT ] ; then - ret=3 - break - fi - sleep 1 -done - -exit $ret