MYSQL_LIB="/var/lib/mysql"
MYSQL_RUN="/run/mysql"
-MYSQL_PID="$MYSQL_RUN/mysqld.pid"
+MYSQL_PIDFILE="$MYSQL_RUN/mysqld.pid"
MYSQL_BIN="/usr/bin"
wait_for_ready() {
# We don't use start-stop-daemon because mysqld has its own
# wrapper script.
printf "Starting mysql ... "
- $MYSQL_BIN/mysqld_safe --pid-file=$MYSQL_PID --user=mysql \
+ $MYSQL_BIN/mysqld_safe --pid-file=$MYSQL_PIDFILE --user=mysql \
> /dev/null 2>&1 &
wait_for_ready
[ $? = 0 ] && echo "OK" || echo "FAIL"
stop() {
printf "Stopping mysql ... "
- if [ -f $MYSQL_PID ]; then
- kill `cat $MYSQL_PID` > /dev/null 2>&1
+ if [ -f $MYSQL_PIDFILE ]; then
+ kill `cat $MYSQL_PIDFILE` > /dev/null 2>&1
[ $? = 0 ] && echo "OK" || echo "FAIL"
else
echo "FAIL"