Skip to content

Commit 00ca810

Browse files
author
Shishir Jaiswal
committed
Bug#25572504 - PID.SHUTDOWN PRESENT.SERVER WILL NOT RESTART
EROR WHEN STARTING >1 MYSQLD_SAFES DESCRIPTION =========== Script mysqld_safe isn't bringing the server up when the latter is crashing due to some reason. The log file reads as given below: "$$$.pid.shutdown present. The server will not restart." ANALYSIS ======== Whenever we run "/etc/init.d/mysql stop" (or any other command which internally calls it), a "$$$.pid.shutdown" file is created to verify a graceful exit. During normal shutdown this file is expected to be removed as part of cleanup. As part of code refactoring done in patch to Bug#11751149, we missed deleting the "$$$pid.shutdown" file in one of the exit cases. As a result of which whenever a crash occurs, none of the "$$$.pid" file and "$$$.pid.shutdown" file is deleted. Now on finding the latter, the mysqld_safe script refuses to restart the server and eventually comes to a halt (which by its behaviour is correct!) The "$$$pid.shutdown" file has to be deleted in this case. FIX === Reverted the part of code change in Bug#11751149, so that now the files are deleted in such a case.
1 parent 47bd3f7 commit 00ca810

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/mysqld_safe.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,6 @@ do
919919
if test -f "$pid_file.shutdown" # created to signal that it must stop
920920
then
921921
log_notice "$pid_file.shutdown present. The server will not restart."
922-
if [ ! -h "$pid_file.shutdown" ]; then
923-
rm -f "$pid_file.shutdown"
924-
fi
925922
break
926923
fi
927924

@@ -992,4 +989,12 @@ do
992989
log_notice "mysqld restarted"
993990
done
994991

992+
if [ ! -h "$pid_file.shutdown" ]; then
993+
rm -f "$pid_file.shutdown"
994+
fi
995+
995996
log_notice "mysqld from pid file $pid_file ended"
997+
998+
if [ ! -h "$safe_pid" ]; then
999+
rm -f "$safe_pid" # Some Extra Safety. File is deleted
1000+
fi # once the mysqld process ends.

0 commit comments

Comments
 (0)