Check if correct process is running in mysql-wait-ready script
Related: #1026313
This commit is contained in:
parent
2e73b0f970
commit
eb0830bac9
@ -27,13 +27,22 @@ get_mysql_option mysqld datadir "/var/lib/mysql"
|
|||||||
datadir="$result"
|
datadir="$result"
|
||||||
get_mysql_option mysqld socket "/var/lib/mysql/mysql.sock"
|
get_mysql_option mysqld socket "/var/lib/mysql/mysql.sock"
|
||||||
socketfile="$result"
|
socketfile="$result"
|
||||||
|
get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
|
||||||
|
mypidfile="$result"
|
||||||
|
|
||||||
# Wait for the server to come up or for the mysqld process to disappear
|
# Wait for the server to come up or for the mysqld process to disappear
|
||||||
ret=0
|
ret=0
|
||||||
while /bin/true; do
|
while /bin/true; do
|
||||||
|
MYSQLDRUNNING=0
|
||||||
|
if [ -f "$mypidfile" ]; then
|
||||||
|
MYSQLPID=`cat "$mypidfile" 2>/dev/null`
|
||||||
|
if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then
|
||||||
|
MYSQLDRUNNING=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||||
mret=$?
|
mret=$?
|
||||||
if [ $mret -eq 0 ]; then
|
if [ $mret -eq 0 ] && [ $MYSQLDRUNNING -eq 1 ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||||||
|
@ -801,6 +801,8 @@ fi
|
|||||||
* Mon Nov 4 2013 Honza Horak <hhorak@redhat.com> 1:5.5.33a-3
|
* Mon Nov 4 2013 Honza Horak <hhorak@redhat.com> 1:5.5.33a-3
|
||||||
- Add pam-devel to build-requires in order to build
|
- Add pam-devel to build-requires in order to build
|
||||||
Related: #1019945
|
Related: #1019945
|
||||||
|
- Check if correct process is running in mysql-wait-ready script
|
||||||
|
Related: #1026313
|
||||||
|
|
||||||
* Mon Oct 14 2013 Honza Horak <hhorak@redhat.com> 1:5.5.33a-2
|
* Mon Oct 14 2013 Honza Horak <hhorak@redhat.com> 1:5.5.33a-2
|
||||||
- Turn on test suite
|
- Turn on test suite
|
||||||
|
Loading…
Reference in New Issue
Block a user