Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions 5.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stderr can be very useful sometimes. We should not always suppress it. So here I removed the '&'.

break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions 5.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions 5.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )

for i in {30..0}; do
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
echo 'Trying to connect to mysql...'
if echo 'SELECT 1' | "${mysql[@]}" > /dev/null; then
break
fi
echo 'MySQL init process in progress...'
echo 'MySQL init process must be in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
Expand Down